def test_is_provider_configured_no_driver(self): ''' Tests when provider driver is not in opts ''' opts = {'providers': {'foo': 'baz'}} provider = 'foo:bar' self.assertFalse(sconfig.is_provider_configured(opts, provider))
def test_is_provider_configured_no_alias(self): ''' Tests when provider alias is not in opts ''' opts = {'providers': 'test'} provider = 'foo:bar' self.assertFalse(sconfig.is_provider_configured(opts, provider))
def test_is_provider_configured_multiple_driver_not_provider(self): ''' Tests when the drive is not the same as the provider when searching through multiple providers ''' opts = {'providers': {'foo': {'bar': {'api_key': 'baz'}}}} provider = 'foo' self.assertFalse(sconfig.is_provider_configured(opts, provider))
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or __virtualname__, ('token',) )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'pyrax' )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'aws', ('id', 'key', 'keyname', 'securitygroup', 'private_key') )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'digital_ocean', ('api_key',) )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or __virtualname__, ('subscription_id', 'certificate_path',) )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'nova', ('auth_minion',) )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or __virtualname__, ('access_key_id', 'secret_access_key', 'zone', 'key_filename') )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'aliyun', ('id', 'key') )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or __virtualname__, ('user', 'tenant', 'identity_url', 'compute_region',) )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or __virtualname__, ('username', 'password', 'datacenter_id') )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'ibmsce', ('user', 'password') )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'opennebula', ('xml_rpc', 'user', 'password') )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'rackspace', ('user', 'apikey') )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'cloudstack', ('apikey', 'secretkey', 'host', 'path') )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'vsphere', ('user',) )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'linode', ('apikey',) )
def get_configured_provider(): """ Return the first configured instance. """ return config.is_provider_configured( __opts__, __active_provider_name__ or "qingcloud", ("access_key_id", "secret_access_key", "zone", "key_filename"), )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'gogrid', ('apikey', 'sharedsecret') )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'dimensiondata', ('user_id', 'key', 'region') )
def test_is_provider_configured_key_is_none(self): ''' Tests when a required configuration key is not set ''' opts = {'providers': {'foo': {'bar': {'api_key': None}}}} provider = 'foo:bar' self.assertFalse( sconfig.is_provider_configured(opts, provider, required_keys=('api_key',)))
def get_configured_provider(): """ Return the first configured instance. """ configured = config.is_provider_configured( __opts__, __active_provider_name__ or __virtualname__, () # keys we need from the provider configuration ) return configured
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'vcloud', ('user', 'org', 'secret', 'host',) )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'gce', ('project', 'service_account_email_address', 'service_account_private_key') )
def test_is_provider_configured_success(self): ''' Tests successful cloud provider configuration ''' opts = {'providers': {'foo': {'bar': {'api_key': 'baz'}}}} provider = 'foo:bar' ret = {'api_key': 'baz'} self.assertEqual( sconfig.is_provider_configured(opts, provider, required_keys=('api_key',)), ret)
def test_is_provider_configured_multiple_success(self): ''' Tests successful cloud provider configuration when searching through multiple providers ''' opts = {'providers': {'foo': {'bar': {'api_key': 'baz'}}}} provider = 'bar' ret = {'api_key': 'baz'} self.assertEqual( sconfig.is_provider_configured(opts, provider, required_keys=('api_key',)), ret)
def get_configured_provider(): ''' Return the first configured instance. ''' warn_until( 'Carbon', 'The vsphere driver is deprecated in favor of the vmware driver and will be removed ' 'in Salt Carbon. Please convert your vsphere provider configs to use the vmware driver.' ) return config.is_provider_configured( __opts__, __active_provider_name__ or 'vsphere', ('user',) )
def get_configured_provider(): ''' Return the first configured instance. ''' warn_until( 'Beryllium', 'The digital_ocean driver is deprecated and will be removed in Salt Beryllium. ' 'Please convert your digital ocean provider configs to use the digital_ocean_v2 ' 'driver.' ) return config.is_provider_configured( __opts__, __active_provider_name__ or 'digital_ocean', ('personal_access_token',) )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured(__opts__, __active_provider_name__ or 'aliyun', ('id', 'key'))
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'softlayer_hw', ('apikey', ))
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'rackspace', ('user', 'apikey'))
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or __virtualname__, ('url', ))
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured(__opts__, __active_provider_name__ or 'proxmox', ('user', ))
def get_configured_provider(): ''' Return the first configured instance ''' return config.is_provider_configured(__opts__, __active_provider_name__ or 'vultr', ('api_key', ))
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'digital_ocean', ('api_key', ))
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured(__opts__, __active_provider_name__ or 'saltify', ())
def get_configured_provider(): """ Return the first configured instance """ return config.is_provider_configured(__opts__, __active_provider_name__ or "vultr", ("api_key", ))
def get_configured_provider(): """ Return the first configured instance. """ return config.is_provider_configured(__opts__, __active_provider_name__ or "saltify", ())
def create(vm_): """ get the system build going """ creds = get_creds() clc.v1.SetCredentials(creds["token"], creds["token_pass"]) cloud_profile = config.is_provider_configured( __opts__, __active_provider_name__ or __virtualname__, ("token", )) group = config.get_cloud_config_value( "group", vm_, __opts__, search_global=False, default=None, ) name = vm_["name"] description = config.get_cloud_config_value( "description", vm_, __opts__, search_global=False, default=None, ) ram = config.get_cloud_config_value( "ram", vm_, __opts__, search_global=False, default=None, ) backup_level = config.get_cloud_config_value( "backup_level", vm_, __opts__, search_global=False, default=None, ) template = config.get_cloud_config_value( "template", vm_, __opts__, search_global=False, default=None, ) password = config.get_cloud_config_value( "password", vm_, __opts__, search_global=False, default=None, ) cpu = config.get_cloud_config_value( "cpu", vm_, __opts__, search_global=False, default=None, ) network = config.get_cloud_config_value( "network", vm_, __opts__, search_global=False, default=None, ) location = config.get_cloud_config_value( "location", vm_, __opts__, search_global=False, default=None, ) if len(name) > 6: name = name[0:6] if len(password) < 9: password = "" clc_return = clc.v1.Server.Create( alias=None, location=(location), name=(name), template=(template), cpu=(cpu), ram=(ram), backup_level=(backup_level), group=(group), network=(network), description=(description), password=(password), ) req_id = clc_return["RequestID"] vm_["ssh_host"] = get_build_status(req_id, name) __utils__["cloud.fire_event"]( "event", "waiting for ssh", "salt/cloud/{0}/waiting_for_ssh".format(name), sock_dir=__opts__["sock_dir"], args={ "ip_address": vm_["ssh_host"] }, transport=__opts__["transport"], ) # Bootstrap! ret = __utils__["cloud.bootstrap"](vm_, __opts__) return_message = {"Server Name": name, "IP Address": vm_["ssh_host"]} ret.update(return_message) return return_message
def get_configured_provider(): """ Return the first configured instance. """ return config.is_provider_configured( __opts__, __active_provider_name__ or __virtualname__, ("id", "key"))
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured(__opts__, __active_provider_name__ or 'nova', ('auth_minion', ))
def get_configured_provider(): """ Return the first configured instance. """ return config.is_provider_configured( __opts__, _get_active_provider_name() or __virtualname__, ("token", ))
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( __opts__, __active_provider_name__ or 'scaleway', ('token', ))
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured(__opts__, __active_provider_name__ or 'joyent', ('user', 'password'))