# Path: conjureup/juju.py
# def get_credential(cloud, cred_name=None):
#     """ Get credential
# 
#     Arguments:
#     cloud: cloud applicable to user credentials
#     cred_name: name of credential to get, or default
#     """
#     creds = get_credentials()
#     if cloud not in creds.keys():
#         return None
# 
#     cred = creds[cloud]
# 
#     default_credential = cred.pop('default-credential', None)
#     cred.pop('default-region', None)
# 
#     if cred_name is not None and cred_name in cred.keys():
#         return cred[cred_name]
#     elif default_credential is not None and default_credential in cred.keys():
#         return cred[default_credential]
#     elif len(cred) == 1:
#         return list(cred.values())[0]
#     else:
#         return None


import inspect
import sys
from conjureup.juju import get_credential
class CloudSigmaCredential(BaseCredential):
    CLOUD_TYPE = 'cloudsigma'


class JoyentCredential(BaseCredential):
    CLOUD_TYPE = 'joyent'


class OpenStackCredential(BaseCredential):
    CLOUD_TYPE = 'openstack'


class VSphereCredential(BaseCredential):
    CLOUD_TYPE = 'vsphere'

    @property
    def username(self):
        return self._credential['user']

    @property
    def password(self):
        return self._credential['password']

    def to_dict(self):
        return {'username': self.username,
                'password': self.password}


class CredentialManager:
    @classmethod

# Path: conjureup/juju.py
# def get_credential(cloud, cred_name=None):
#     """ Get credential
# 
#     Arguments:
#     cloud: cloud applicable to user credentials
#     cred_name: name of credential to get, or default
#     """
#     creds = get_credentials()
#     if cloud not in creds.keys():
#         return None
# 
#     cred = creds[cloud]
# 
#     default_credential = cred.pop('default-credential', None)
#     cred.pop('default-region', None)
# 
#     if cred_name is not None and cred_name in cred.keys():
#         return cred[cred_name]
#     elif default_credential is not None and default_credential in cred.keys():
#         return cred[default_credential]
#     elif len(cred) == 1:
#         return list(cred.values())[0]
#     else:
#         return None


# Path: conjureup/models/credential.py
import inspect
import sys
from conjureup.juju import get_credential

class CloudSigmaCredential(BaseCredential):
    CLOUD_TYPE = 'cloudsigma'


class JoyentCredential(BaseCredential):
    CLOUD_TYPE = 'joyent'


class OpenStackCredential(BaseCredential):
    CLOUD_TYPE = 'openstack'


class VSphereCredential(BaseCredential):
    CLOUD_TYPE = 'vsphere'

    @property
    def username(self):
        return self._credential['user']

    @property
    def password(self):
        return self._credential['password']

    def to_dict(self):
        return {'username': self.username,
                'password': self.password}


class CredentialManager:
    @classmethod

    def get_credential(cls, cloud, cloud_type, credential_name):