def __init__(self): configManager = ConfigManager() self.__os_username = configManager.get_admin_user() self.__os_password = configManager.get_admin_pass() self.__os_auth_url = configManager.get_oauth_url() self.__os_tenant_admin = configManager.get_admin_tenant() self.__os_compute_nodes = ast.literal_eval(configManager.get_computenodes_map())
def __init__(self, config=""): configManager = ConfigManager() self.__os_username = configManager.get_admin_user() self.__os_password = configManager.get_admin_pass() self.__os_auth_url = configManager.get_oauth_url() self.__admin_tenant_id = configManager.get_admin_tenant() self.__os_compute_nodes = ast.literal_eval(configManager.get_computenodes_map()) # self.__os_username = config.get('Openstack', 'osusername') # self.__os_password = config.get('Openstack', 'ospassword') # self.__os_auth_url = config.get('Openstack', 'osauthurl') # self.__admin_tenant_id = config.get('Openstack', 'AdminTenantId') self.__keystone = client.Client(username=self.__os_username, password=self.__os_password, auth_url=self.__os_auth_url) self.projects = [ {'name' : i.name, 'id' : i.id} for i in self.__keystone.tenants.list() ] self.tenants = self.__keystone.tenants.list()