Merge pull request #43588 from gtmanfred/do

digitalocean should be one word.
This commit is contained in:
Nicole Thomas 2017-09-21 09:25:38 -04:00 committed by GitHub
commit f66eb1c5ad
21 changed files with 88 additions and 84 deletions

View file

@ -3,7 +3,7 @@
# directory is identical.
#my-digitalocean-config:
# driver: digital_ocean
# driver: digitalocean
# client_key: wFGEwgregeqw3435gDger
# api_key: GDE43t43REGTrkilg43934t34qT43t4dgegerGEgg
# location: New York 1

View file

@ -1,5 +1,5 @@
#my-digitalocean-config:
# driver: digital_ocean
# driver: digitalocean
# client_key: wFGEwgregeqw3435gDger
# api_key: GDE43t43REGTrkilg43934t34qT43t4dgegerGEgg
# location: New York 1

View file

@ -136,7 +136,7 @@ Query Options
.. versionadded:: 2014.7.0
Display a list of configured profiles. Pass in a cloud provider to view
the provider's associated profiles, such as ``digital_ocean``, or pass in
the provider's associated profiles, such as ``digitalocean``, or pass in
``all`` to list all the configured profiles.

View file

@ -13,7 +13,7 @@ Full list of Salt Cloud modules
aliyun
azurearm
cloudstack
digital_ocean
digitalocean
dimensiondata
ec2
gce

View file

@ -1,6 +1,6 @@
===============================
salt.cloud.clouds.digital_ocean
salt.cloud.clouds.digitalocean
===============================
.. automodule:: salt.cloud.clouds.digital_ocean
.. automodule:: salt.cloud.clouds.digitalocean
:members:

View file

@ -183,7 +183,7 @@ imports should be absent from the Salt Cloud module.
A good example of a non-libcloud driver is the DigitalOcean driver:
https://github.com/saltstack/salt/tree/develop/salt/cloud/clouds/digital_ocean.py
https://github.com/saltstack/salt/tree/develop/salt/cloud/clouds/digitalocean.py
The ``create()`` Function
-------------------------

View file

@ -444,7 +444,7 @@ under the API Access tab.
.. code-block:: yaml
my-digitalocean-config:
driver: digital_ocean
driver: digitalocean
personal_access_token: xxx
location: New York 1

View file

@ -19,7 +19,7 @@ under the "SSH Keys" section.
# /etc/salt/cloud.providers.d/ directory.
my-digitalocean-config:
driver: digital_ocean
driver: digitalocean
personal_access_token: xxx
ssh_key_file: /path/to/ssh/key/file
ssh_key_names: my-key-name,my-key-name-2
@ -63,7 +63,7 @@ command:
# salt-cloud --list-locations my-digitalocean-config
my-digitalocean-config:
----------
digital_ocean:
digitalocean:
----------
Amsterdam 1:
----------
@ -87,7 +87,7 @@ command:
# salt-cloud --list-sizes my-digitalocean-config
my-digitalocean-config:
----------
digital_ocean:
digitalocean:
----------
512MB:
----------
@ -117,7 +117,7 @@ command:
# salt-cloud --list-images my-digitalocean-config
my-digitalocean-config:
----------
digital_ocean:
digitalocean:
----------
10.1:
----------
@ -142,7 +142,7 @@ Profile Specifics:
ssh_username
------------
If using a FreeBSD image from Digital Ocean, you'll need to set the ``ssh_username``
If using a FreeBSD image from DigitalOcean, you'll need to set the ``ssh_username``
setting to ``freebsd`` in your profile configuration.
.. code-block:: yaml

View file

@ -219,7 +219,7 @@ the default cloud provider configuration file for DigitalOcean looks like this:
.. code-block:: yaml
digitalocean-config:
driver: digital_ocean
driver: digitalocean
client_key: ''
api_key: ''
location: New York 1
@ -230,7 +230,7 @@ must be provided:
.. code-block:: yaml
digitalocean-config:
driver: digital_ocean
driver: digitalocean
client_key: wFGEwgregeqw3435gDger
api_key: GDE43t43REGTrkilg43934t34qT43t4dgegerGEgg
location: New York 1

View file

@ -541,7 +541,7 @@ provider configuration file in the integration test file directory located at
``tests/integration/files/conf/cloud.*.d/``.
The following is an example of the default profile configuration file for Digital
Ocean, located at: ``tests/integration/files/conf/cloud.profiles.d/digital_ocean.conf``:
Ocean, located at: ``tests/integration/files/conf/cloud.profiles.d/digitalocean.conf``:
.. code-block:: yaml
@ -557,12 +557,12 @@ be provided by the user by editing the provider configuration file before runnin
tests.
The following is an example of the default provider configuration file for Digital
Ocean, located at: ``tests/integration/files/conf/cloud.providers.d/digital_ocean.conf``:
Ocean, located at: ``tests/integration/files/conf/cloud.providers.d/digitalocean.conf``:
.. code-block:: yaml
digitalocean-config:
driver: digital_ocean
driver: digitalocean
client_key: ''
api_key: ''
location: New York 1

View file

@ -116,6 +116,14 @@ Newer PyWinRM Versions
Versions of ``pywinrm>=0.2.1`` are finally able to disable validation of self
signed certificates. :ref:`Here<new-pywinrm>` for more information.
DigitalOcean
------------
The DigitalOcean driver has been renamed to conform to the companies name. The
new driver name is ``digitalocean``. The old name ``digital_ocean`` and a
short one ``do`` will still be supported through virtual aliases, this is mostly
cosmetic.
Solaris Logical Domains In Virtual Grain
----------------------------------------

View file

@ -13,7 +13,7 @@ Using Apache Libcloud for declarative and procedural multi-cloud orchestration
Apache Libcloud is a Python library which hides differences between different cloud provider APIs and allows
you to manage different cloud resources through a unified and easy to use API. Apache Libcloud supports over
60 cloud platforms, including Amazon, Microsoft Azure, Digital Ocean, Google Cloud Platform and OpenStack.
60 cloud platforms, including Amazon, Microsoft Azure, DigitalOcean, Google Cloud Platform and OpenStack.
Execution and state modules are available for Compute, DNS, Storage and Load Balancer drivers from Apache Libcloud in
SaltStack.

View file

@ -20,7 +20,7 @@ under the "SSH Keys" section.
personal_access_token: xxx
ssh_key_file: /path/to/ssh/key/file
ssh_key_names: my-key-name,my-key-name-2
driver: digital_ocean
driver: digitalocean
:depends: requests
'''
@ -59,10 +59,11 @@ except ImportError:
# Get logging started
log = logging.getLogger(__name__)
__virtualname__ = 'digital_ocean'
__virtualname__ = 'digitalocean'
__virtual_aliases__ = ('digital_ocean', 'do')
# Only load in this module if the DIGITAL_OCEAN configurations are in place
# Only load in this module if the DIGITALOCEAN configurations are in place
def __virtual__():
'''
Check for DigitalOcean configurations
@ -274,7 +275,7 @@ def create(vm_):
try:
# Check for required profile parameters before sending any API calls.
if vm_['profile'] and config.is_profile_configured(__opts__,
__active_provider_name__ or 'digital_ocean',
__active_provider_name__ or 'digitalocean',
vm_['profile'],
vm_=vm_) is False:
return False
@ -441,7 +442,7 @@ def create(vm_):
ret = create_node(kwargs)
except Exception as exc:
log.error(
'Error creating {0} on DIGITAL_OCEAN\n\n'
'Error creating {0} on DIGITALOCEAN\n\n'
'The following exception was thrown when trying to '
'run the initial deployment: {1}'.format(
vm_['name'],
@ -716,12 +717,12 @@ def import_keypair(kwargs=None, call=None):
with salt.utils.files.fopen(kwargs['file'], 'r') as public_key_filename:
public_key_content = public_key_filename.read()
digital_ocean_kwargs = {
digitalocean_kwargs = {
'name': kwargs['keyname'],
'public_key': public_key_content
}
created_result = create_key(digital_ocean_kwargs, call=call)
created_result = create_key(digitalocean_kwargs, call=call)
return created_result
@ -938,11 +939,11 @@ def show_pricing(kwargs=None, call=None):
if not profile:
return {'Error': 'The requested profile was not found'}
# Make sure the profile belongs to Digital Ocean
# Make sure the profile belongs to DigitalOcean
provider = profile.get('provider', '0:0')
comps = provider.split(':')
if len(comps) < 2 or comps[1] != 'digital_ocean':
return {'Error': 'The requested profile does not belong to Digital Ocean'}
if len(comps) < 2 or comps[1] != 'digitalocean':
return {'Error': 'The requested profile does not belong to DigitalOcean'}
raw = {}
ret = {}

View file

@ -2643,7 +2643,7 @@ def show_pricing(kwargs=None, call=None):
if not profile:
return {'Error': 'The requested profile was not found'}
# Make sure the profile belongs to Digital Ocean
# Make sure the profile belongs to DigitalOcean
provider = profile.get('provider', '0:0')
comps = provider.split(':')
if len(comps) < 2 or comps[1] != 'gce':

View file

@ -2721,7 +2721,7 @@ def old_to_new(opts):
providers = (
'AWS',
'CLOUDSTACK',
'DIGITAL_OCEAN',
'DIGITALOCEAN',
'EC2',
'GOGRID',
'IBMSCE',

View file

@ -1547,7 +1547,7 @@ class CloudQueriesMixIn(six.with_metaclass(MixInMeta, object)):
action='store',
help='Display a list of configured profiles. Pass in a cloud '
'provider to view the provider\'s associated profiles, '
'such as digital_ocean, or pass in "all" to list all the '
'such as digitalocean, or pass in "all" to list all the '
'configured profiles.'
)
self.add_option_group(group)

View file

@ -17,7 +17,7 @@ from salt.config import cloud_providers_config
# Create the cloud instance name to be used throughout the tests
INSTANCE_NAME = generate_random_name('CLOUD-TEST-')
PROVIDER_NAME = 'digital_ocean'
PROVIDER_NAME = 'digitalocean'
class DigitalOceanTest(ShellCase):
@ -66,7 +66,7 @@ class DigitalOceanTest(ShellCase):
def test_list_images(self):
'''
Tests the return of running the --list-images command for digital ocean
Tests the return of running the --list-images command for digitalocean
'''
image_list = self.run_cloud('--list-images {0}'.format(PROVIDER_NAME))
self.assertIn(
@ -76,7 +76,7 @@ class DigitalOceanTest(ShellCase):
def test_list_locations(self):
'''
Tests the return of running the --list-locations command for digital ocean
Tests the return of running the --list-locations command for digitalocean
'''
_list_locations = self.run_cloud('--list-locations {0}'.format(PROVIDER_NAME))
self.assertIn(
@ -86,7 +86,7 @@ class DigitalOceanTest(ShellCase):
def test_list_sizes(self):
'''
Tests the return of running the --list-sizes command for digital ocean
Tests the return of running the --list-sizes command for digitalocean
'''
_list_sizes = self.run_cloud('--list-sizes {0}'.format(PROVIDER_NAME))
self.assertIn(

View file

@ -40,11 +40,11 @@ class CloudClientTestCase(ShellCase):
@expensiveTest
def setUp(self):
self.config_file = os.path.join(RUNTIME_VARS.TMP_CONF_CLOUD_PROVIDER_INCLUDES,
'digital_ocean.conf')
'digitalocean.conf')
self.provider_name = 'digitalocean-config'
self.image_name = '14.04.5 x64'
# Use a --list-images salt-cloud call to see if the Digital Ocean provider is
# Use a --list-images salt-cloud call to see if the DigitalOcean provider is
# configured correctly before running any tests.
images = self.run_cloud('--list-images {0}'.format(self.provider_name))

View file

@ -1,5 +1,5 @@
digitalocean-config:
driver: digital_ocean
driver: digitalocean
personal_access_token: ''
ssh_key_file: ''
ssh_key_name: ''

View file

@ -727,8 +727,8 @@ class ConfigTestCase(TestCase, AdaptedConfigurationTestCaseMixin):
Tests passing in valid provider and profile config files successfully
'''
providers = {'test-provider':
{'digital_ocean':
{'driver': 'digital_ocean', 'profiles': {}}}}
{'digitalocean':
{'driver': 'digitalocean', 'profiles': {}}}}
overrides = {'test-profile':
{'provider': 'test-provider',
'image': 'Ubuntu 12.10 x64',
@ -736,7 +736,7 @@ class ConfigTestCase(TestCase, AdaptedConfigurationTestCaseMixin):
'conf_file': PATH}
ret = {'test-profile':
{'profile': 'test-profile',
'provider': 'test-provider:digital_ocean',
'provider': 'test-provider:digitalocean',
'image': 'Ubuntu 12.10 x64',
'size': '512MB'}}
self.assertEqual(sconfig.apply_vm_profiles_config(providers,

View file

@ -136,7 +136,7 @@ class ConfigTestCase(TestCase):
def test_optional_requirements_config(self):
class BaseRequirements(schema.Schema):
driver = schema.StringItem(default='digital_ocean', format='hidden')
driver = schema.StringItem(default='digitalocean', format='hidden')
class SSHKeyFileSchema(schema.Schema):
ssh_key_file = schema.StringItem(
@ -149,13 +149,13 @@ class ConfigTestCase(TestCase):
ssh_key_names = schema.StringItem(
title='SSH Key Names',
description='The names of an SSH key being managed on '
'Digital Ocean account which will be used to '
'DigitalOcean account which will be used to '
'authenticate on the deployed VMs',
)
class Requirements(BaseRequirements):
title = 'Digital Ocean'
description = 'Digital Ocean Cloud VM configuration requirements.'
title = 'DigitalOcean'
description = 'DigitalOcean Cloud VM configuration requirements.'
personal_access_token = schema.StringItem(
title='Personal Access Token',
@ -174,12 +174,12 @@ class ConfigTestCase(TestCase):
expected = {
'$schema': 'http://json-schema.org/draft-04/schema#',
'title': 'Digital Ocean',
'description': 'Digital Ocean Cloud VM configuration requirements.',
'title': 'DigitalOcean',
'description': 'DigitalOcean Cloud VM configuration requirements.',
'type': 'object',
'properties': {
'driver': {
'default': 'digital_ocean',
'default': 'digitalocean',
'format': 'hidden',
'type': 'string',
'title': 'driver'
@ -198,9 +198,8 @@ class ConfigTestCase(TestCase):
},
'ssh_key_names': {
'type': 'string',
'description': 'The names of an SSH key being managed on Digital '
'Ocean account which will be used to authenticate '
'on the deployed VMs',
'description': 'The names of an SSH key being managed on DigitalOcean '
'account which will be used to authenticate on the deployed VMs',
'title': 'SSH Key Names'
}
},
@ -222,8 +221,8 @@ class ConfigTestCase(TestCase):
self.assertDictEqual(expected, Requirements.serialize())
class Requirements2(BaseRequirements):
title = 'Digital Ocean'
description = 'Digital Ocean Cloud VM configuration requirements.'
title = 'DigitalOcean'
description = 'DigitalOcean Cloud VM configuration requirements.'
personal_access_token = schema.StringItem(
title='Personal Access Token',
@ -239,7 +238,7 @@ class ConfigTestCase(TestCase):
ssh_key_names = schema.StringItem(
title='SSH Key Names',
description='The names of an SSH key being managed on '
'Digital Ocean account which will be used to '
'DigitalOcean account which will be used to '
'authenticate on the deployed VMs')
requirements_definition = schema.AnyOfItem(
@ -251,12 +250,12 @@ class ConfigTestCase(TestCase):
expected = {
'$schema': 'http://json-schema.org/draft-04/schema#',
'title': 'Digital Ocean',
'description': 'Digital Ocean Cloud VM configuration requirements.',
'title': 'DigitalOcean',
'description': 'DigitalOcean Cloud VM configuration requirements.',
'type': 'object',
'properties': {
'driver': {
'default': 'digital_ocean',
'default': 'digitalocean',
'format': 'hidden',
'type': 'string',
'title': 'driver'
@ -275,9 +274,8 @@ class ConfigTestCase(TestCase):
},
'ssh_key_names': {
'type': 'string',
'description': 'The names of an SSH key being managed on Digital '
'Ocean account which will be used to authenticate '
'on the deployed VMs',
'description': 'The names of an SSH key being managed on DigitalOcean '
'account which will be used to authenticate on the deployed VMs',
'title': 'SSH Key Names'
}
},
@ -299,19 +297,19 @@ class ConfigTestCase(TestCase):
self.assertDictContainsSubset(expected, Requirements2.serialize())
class Requirements3(schema.Schema):
title = 'Digital Ocean'
description = 'Digital Ocean Cloud VM configuration requirements.'
title = 'DigitalOcean'
description = 'DigitalOcean Cloud VM configuration requirements.'
merge_reqs = Requirements(flatten=True)
expected = {
'$schema': 'http://json-schema.org/draft-04/schema#',
'title': 'Digital Ocean',
'description': 'Digital Ocean Cloud VM configuration requirements.',
'title': 'DigitalOcean',
'description': 'DigitalOcean Cloud VM configuration requirements.',
'type': 'object',
'properties': {
'driver': {
'default': 'digital_ocean',
'default': 'digitalocean',
'format': 'hidden',
'type': 'string',
'title': 'driver'
@ -330,9 +328,8 @@ class ConfigTestCase(TestCase):
},
'ssh_key_names': {
'type': 'string',
'description': 'The names of an SSH key being managed on Digital '
'Ocean account which will be used to authenticate '
'on the deployed VMs',
'description': 'The names of an SSH key being managed on DigitalOcean '
'account which will be used to authenticate on the deployed VMs',
'title': 'SSH Key Names'
}
},
@ -354,8 +351,8 @@ class ConfigTestCase(TestCase):
self.assertDictContainsSubset(expected, Requirements3.serialize())
class Requirements4(schema.Schema):
title = 'Digital Ocean'
description = 'Digital Ocean Cloud VM configuration requirements.'
title = 'DigitalOcean'
description = 'DigitalOcean Cloud VM configuration requirements.'
merge_reqs = Requirements(flatten=True)
@ -367,7 +364,7 @@ class ConfigTestCase(TestCase):
ssh_key_names_2 = schema.StringItem(
title='SSH Key Names',
description='The names of an SSH key being managed on '
'Digital Ocean account which will be used to '
'DigitalOcean account which will be used to '
'authenticate on the deployed VMs')
requirements_definition_2 = schema.AnyOfItem(
@ -379,12 +376,12 @@ class ConfigTestCase(TestCase):
expected = {
'$schema': 'http://json-schema.org/draft-04/schema#',
'title': 'Digital Ocean',
'description': 'Digital Ocean Cloud VM configuration requirements.',
'title': 'DigitalOcean',
'description': 'DigitalOcean Cloud VM configuration requirements.',
'type': 'object',
'properties': {
'driver': {
'default': 'digital_ocean',
'default': 'digitalocean',
'format': 'hidden',
'type': 'string',
'title': 'driver'
@ -403,9 +400,8 @@ class ConfigTestCase(TestCase):
},
'ssh_key_names': {
'type': 'string',
'description': 'The names of an SSH key being managed on Digital '
'Ocean account which will be used to authenticate '
'on the deployed VMs',
'description': 'The names of an SSH key being managed on DigitalOcean '
'account which will be used to authenticate on the deployed VMs',
'title': 'SSH Key Names'
},
'ssh_key_file_2': {
@ -416,9 +412,8 @@ class ConfigTestCase(TestCase):
},
'ssh_key_names_2': {
'type': 'string',
'description': 'The names of an SSH key being managed on Digital '
'Ocean account which will be used to authenticate '
'on the deployed VMs',
'description': 'The names of an SSH key being managed on DigitalOcean '
'account which will be used to authenticate on the deployed VMs',
'title': 'SSH Key Names'
}
},
@ -446,7 +441,7 @@ class ConfigTestCase(TestCase):
@skipIf(HAS_JSONSCHEMA is False, 'The \'jsonschema\' library is missing')
def test_optional_requirements_config_validation(self):
class BaseRequirements(schema.Schema):
driver = schema.StringItem(default='digital_ocean', format='hidden')
driver = schema.StringItem(default='digitalocean', format='hidden')
class SSHKeyFileSchema(schema.Schema):
ssh_key_file = schema.StringItem(
@ -462,8 +457,8 @@ class ConfigTestCase(TestCase):
'authenticate on the deployed VMs')
class Requirements(BaseRequirements):
title = 'Digital Ocean'
description = 'Digital Ocean Cloud VM configuration requirements.'
title = 'DigitalOcean'
description = 'DigitalOcean Cloud VM configuration requirements.'
personal_access_token = schema.StringItem(
title='Personal Access Token',