def get_hosts(self): config = ConfigManager() hosts = config.get_hosts() host_obj_list = [] for host in hosts: host_obj_list.append(host_from_dict(host)) return host_obj_list
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() server = config.get_db_server() user = config.get_db_user() password = config.get_db_pass() db = config.get_host_db_name() table = config.get_host_db_table() try: self.con = mdb.connect(server, user, password, db) self.table = table; except mdb.Error, e: print "Error %d: %s" % (e.args[0],e.args[1]) return None
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()
def __init__(self): configManager = ConfigManager() self.__ceilometer_api_version = configManager.get_ceilometer_api_version() 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 = configManager.get_admin_tenant() self.__alarm_url = configManager.get_alarm_url() print self.__ceilometer_api_version print self.__os_username print self.__os_password print self.__os_auth_url print self.__admin_tenant print self.__alarm_url self.ceilometer = client.get_client(self.__ceilometer_api_version, os_username=self.__os_username, os_password=self.__os_password, os_tenant_name=self.__admin_tenant, os_auth_url=self.__os_auth_url)