cloudera-labs / cdpy

A Simple Pythonic Client wrapper for Cloudera CDP CLI, designed for use with the Ansible framework
Apache License 2.0
10 stars 22 forks source link

Base 7.1.5 / Private Cloud 1.1 / OpenShift 4.5: sdk.gather_clusters does not work as it seems to expect a string starting with crn:cdp:environments instead of crn:altus:environments #1

Closed marcredhat closed 3 years ago

marcredhat commented 3 years ago

Env: Base 7.1.5 / Private Cloud 1.1 / OpenShift 4.5

Test program: https://github.com/marcredhat/cdpy/blob/main/testprivate1.py

sdk.describe_all_environments()) and sdk.summarize_environment("marccdp")) work fine and display the following CDP environment crn:

RESULT:

[{'environmentName': 'marccdp', 'crn': 'crn:altus:environments:us-west-1:27c485f2-d664-4a62-911c-8454d5ea311a:environment:marccdp/5b56f5d8-6089-43f6-96bb-fa67e9d3ba44', 'status': 'AVAILABLE', 'cloudPlatform': 'OPENSHIFT'}]

Issue: sdk.gather_clusters("crn:altus:environments:us-west-1:27c485f2-d664-4a62-911c-8454d5ea311a:environment:marccdp/5b56f5d8-6089-43f6-96bb-fa67e9d3ba44"))

does not work as it seems to expect a string starting with crn:cdp:environments instead of crn:altus:environments

RESULT (NOK)

cdpy.common.CdpError: CdpError('Supplied env_crn crn:altus:environments:us-west-1:27c485f2-d664-4a62-911c-8454d5ea311a:environment:marccdp/5b56f5d8-6089-43f6-96bb-fa67e9d3ba44 is not a valid CDP Environment crn',)

seems related to the fact that https://github.com/cloudera-labs/cdpy/blob/main/src/cdpy/dw.py expects

a string starting with

crn:cdp:environments instead of

crn:altus:environments