def __init__(self): self.openstack_config = OpenstackCLI_CommonConfig() self.config = NovaCLI_Config() self._cli_kwargs = { 'os_username': self.openstack_config.os_username, 'os_password': self.openstack_config.os_password, 'os_tenant_name': self.openstack_config.os_tenant_name, 'os_auth_url': self.openstack_config.os_auth_url, 'debug': self.openstack_config.debug, 'os_auth_system': self.config.os_auth_system, 'insecure': self.config.insecure, # Allows for individual product configs to override the region name 'os_region_name': self.config.os_region_name or self.openstack_config.os_region_name } self.client = NovaCLI(**self._cli_kwargs) self.client.set_environment_variables( self.config.environment_variable_dictionary)
class NovaCLI_Composite(object): def __init__(self): self.openstack_config = OpenstackCLI_CommonConfig() self.config = NovaCLI_Config() self._cli_kwargs = { 'os_username': self.openstack_config.os_username, 'os_password': self.openstack_config.os_password, 'os_tenant_name': self.openstack_config.os_tenant_name, 'os_auth_url': self.openstack_config.os_auth_url, 'os_region_name': self.openstack_config.os_region_name, 'debug': self.openstack_config.debug, 'os_auth_system': self.config.os_auth_system, 'insecure': self.config.insecure} self.client = NovaCLI(**self._cli_kwargs) self.client.set_environment_variables( self.config.environment_variable_dictionary)
def setUpClass(cls): cls.novacli = NovaCLI( os_cache=True, timings=True, timeout=30, os_username='******', os_password='******', os_tenant_name='FakeTenantName', os_tenant_id='1234567', os_auth_url='os-auth-url', os_region_name='region_name', os_auth_system='auth_system', service_type='service-type', volume_service_name='vol serv name', endpoint_type='endpoint_type', os_compute_api_version='v111', os_cacert='cert_here', insecure=True, bypass_url='bypass_url') cls.base_cmd = cls.novacli.base_cmd()
def __init__(self): self.openstack_config = OpenstackCLI_CommonConfig() self.config = NovaCLI_Config() self._cli_kwargs = { 'os_username': self.openstack_config.os_username, 'os_password': self.openstack_config.os_password, 'os_tenant_name': self.openstack_config.os_tenant_name, 'os_auth_url': self.openstack_config.os_auth_url, 'debug': self.openstack_config.debug, 'os_auth_system': self.config.os_auth_system, 'insecure': self.config.insecure, # Allows for individual product configs to override the region name 'os_region_name': self.config.os_region_name or self.openstack_config.os_region_name} self.client = NovaCLI(**self._cli_kwargs) self.client.set_environment_variables( self.config.environment_variable_dictionary)
def setUpClass(cls): class FakeResponse(object): def __init__(self, cmd): self.command = cmd self.standard_out = "fake standard out" cls.novacli = NovaCLI() cls.novacli.run_command = lambda x: FakeResponse(x) cls.command = cls.novacli.create_server( name='fake name', no_service_net=True, no_public=True, disk_config='auto', flavor='fake flavor', image='fake image', boot_volume='fake boot volume', snapshot='fake snapshot', num_instances='55', key_name='SomeKeyName', user_data='SomeUserData', availability_zone='SomeAvailabilityZone', security_groups='SomeSecurityGroups', swap=100, # Just so that there's an int in this test. config_drive='/dev/sda', image_with={'fake_image_with_key': 'fake_image_with_value'}, meta={ 'fake_meta_key1': 'fake_meta_value1', 'fake_meta_key2': 'fake_meta_value2'}, file_={'dst-path': 'src-path'}, block_device_mapping={'dev-name': 'mapping'}, block_device={'bdkey': 'bdvalue'}, ephemeral={'size': 'SomeSize', 'format': 'SomeFormat'}, hint={'HintKey': 'HintValue'}, nic={ 'net-id': 'Some-net-uuid', 'port-id': 'Some-port-uuid', 'v4-fixed-ip': 'Some-ip-addr'}).command
def test_no_arguments_positive(self): novacli = NovaCLI() self.assertEquals(novacli.base_cmd().strip(), 'nova')
def test_no_arguments_positive(self): novacli = NovaCLI() self.assertEquals(novacli.base_cmd().strip(), "nova")