Example #1
0
 def get_esh_credentials(self, esh_provider):
     cred_map = self.get_credentials()
     if isinstance(esh_provider, OSProvider):
         cred_map['ex_force_auth_url'] = cred_map.pop('auth_url')
     elif isinstance(esh_provider, EucaProvider):
         ec2_url = cred_map.pop('ec2_url')
         url_map = EucaProvider.parse_url(ec2_url)
         cred_map.update(url_map)
     return cred_map
    def get_esh_credentials(self, esh_provider):
        cred_map = self.get_credentials()
        if isinstance(esh_provider, OSProvider):
            cred_map['ex_force_auth_url'] = cred_map.pop('auth_url')
        if cred_map.get('ex_force_auth_version','2.0_password') == '2.0_password'\
                and '/v2.0/tokens' not in cred_map['ex_force_auth_url']:
            cred_map['ex_force_auth_url'] += '/v2.0/tokens'

        elif isinstance(esh_provider, EucaProvider):
            ec2_url = cred_map.pop('ec2_url')
            url_map = EucaProvider.parse_url(ec2_url)
            cred_map.update(url_map)
        return cred_map
Example #3
0
    def get_esh_credentials(self, esh_provider):
        cred_map = self.get_credentials()
        if isinstance(esh_provider, OSProvider):
            cred_map['ex_force_auth_url'] = cred_map.pop('auth_url')
        if cred_map.get('ex_force_auth_version','2.0_password') == '2.0_password'\
                and '/v2.0/tokens' not in cred_map['ex_force_auth_url']:
            cred_map['ex_force_auth_url'] += '/v2.0/tokens'

        elif isinstance(esh_provider, EucaProvider):
            ec2_url = cred_map.pop('ec2_url')
            url_map = EucaProvider.parse_url(ec2_url)
            cred_map.update(url_map)
        return cred_map
Example #4
0
"""
Atmosphere service compute.
"""
from threepio import logger

from rtwo import settings

from rtwo.provider import AWSProvider, EucaProvider, OSProvider
from rtwo.driver import EucaDriver, AWSDriver

from libcloud.common.types import InvalidCredsError

EucaProvider.set_meta()
AWSProvider.set_meta()
OSProvider.set_meta()
Example #5
0
                             AWSDriver,
                             key=settings.AWS_KEY,
                             secret=settings.AWS_SECRET,
                             user="******")


def _initialize_euca():
    if hasattr(settings, 'EUCA_ADMIN_KEY') \
       and hasattr(settings, 'EUCA_ADMIN_SECRET'):
        _initialize_provider(EucaProvider(),
                             EucaDriver,
                             key=settings.EUCA_ADMIN_KEY,
                             secret=settings.EUCA_ADMIN_SECRET,
                             user="******")


def initialize():
    """
    Initialize machines and sizes using an admin identity.

    NOTE: This is required to ensure Eucalyptus and AWS have valid information
    for sizes and machines.
    """
    _initialize_euca()
    _initialize_aws()

EucaProvider.set_meta()
AWSProvider.set_meta()
OSProvider.set_meta()
initialize()
 def __init__(self):
     # TODO: Figure out why this is needed
     OSProvider.set_meta()
     EucaProvider.set_meta()