Merge pull request #35284 from rallytime/cloud-deprecations

Cloud deprecations for Carbon
This commit is contained in:
Mike Place 2016-08-10 00:33:51 +09:00 committed by GitHub
commit 538fa4dead
4 changed files with 13 additions and 73 deletions

View File

@ -188,10 +188,6 @@ assign_private_ip
Assigns a private IP address to a Linode when set to True. Default is False.
private_ip
----------
Deprecated in favor of `assign_private_ip`_ in Salt 2016.3.0.
ssh_interface
-------------
.. versionadded:: 2016.3.0

View File

@ -272,9 +272,6 @@ Deprecations
# will result in refresh evaluating to True and saltenv likely not being a string at all
fcn('add more salt', 'prod', False)
- The ``vsphere`` cloud driver has been removed. Please use the ``vmware`` cloud driver
instead.
- The ``boto_vpc`` execution module had two functions removed,
``boto_vpc.associate_new_dhcp_options_to_vpc`` and
``boto_vpc.associate_new_network_acl_to_subnet`` in favor of more concise function
@ -403,3 +400,16 @@ Deprecations
- The ``zpool_list`` function in the ``zpool`` execution module was removed. Use ``list``
instead.
Cloud Deprecations
------------------
- The ``vsphere`` cloud driver has been removed. Please use the ``vmware`` cloud driver
instead.
- The ``private_ip`` option in the ``linode`` cloud driver is deprecated and has been
removed. Use the ``assign_private_ip`` option instead.
- The ``create_dns_record`` and ``delete_dns_record`` functions are deprecated and have
been removed from the ``digital_ocean`` driver. Use the ``post_dns_record`` function
instead.

View File

@ -877,34 +877,6 @@ def post_dns_record(**kwargs):
return False
# Delete this with create_dns_record() and delete_dns_record() for Carbon release
__deprecated_fqdn_parsing = lambda fqdn: ('.'.join(fqdn.split('.')[-2:]), '.'.join(fqdn.split('.')[:-2]))
def create_dns_record(hostname, ip_address):
salt.utils.warn_until(
'Carbon',
'create_dns_record() is deprecated and will be removed in Carbon. Please use post_dns_record() instead.'
)
return __deprecated_create_dns_record(hostname, ip_address)
def __deprecated_create_dns_record(hostname, ip_address):
domainname, subdomain = __deprecated_fqdn_parsing(hostname)
domain = query(method='domains', droplet_id=domainname)
if domain:
result = query(
method='domains',
droplet_id=domainname,
command='records',
args={'type': 'A', 'name': subdomain, 'data': ip_address},
http_method='post'
)
return result
return False
def destroy_dns_records(fqdn):
'''
@ -940,33 +912,6 @@ def destroy_dns_records(fqdn):
return False
def delete_dns_record(hostname):
salt.utils.warn_until(
'Carbon',
'delete_dns_record() is deprecated and will be removed in Carbon. Please use destroy_dns_records() instead.'
)
return __deprecated_delete_dns_record(hostname)
def __deprecated_delete_dns_record(hostname):
'''
Deletes a DNS for the given hostname if the domain is managed with DO.
'''
domainname, subdomain = __deprecated_fqdn_parsing(hostname)
records = query(method='domains', droplet_id=domainname, command='records')
if records:
for record in records['domain_records']:
if record['name'] == subdomain:
return query(
method='domains',
droplet_id=domainname,
command='records/' + str(record['id']),
http_method='delete'
)
return False
def show_pricing(kwargs=None, call=None):
'''
Show pricing for a particular profile. This is only an estimate, based on

View File

@ -43,7 +43,6 @@ from salt.exceptions import (
SaltCloudNotFound,
SaltCloudSystemExit
)
from salt.utils import warn_until
# Import Salt-Cloud Libs
import salt.utils.cloud
@ -1031,16 +1030,6 @@ def get_private_ip(vm_):
'''
Return True if a private ip address is requested
'''
if 'private_ip' in vm_:
warn_until(
'Carbon',
'The \'private_ip\' option is being deprecated in favor of the '
'\'assign_private_ip\' option. Please convert your Linode configuration '
'files to use \'assign_private_ip\'.'
)
vm_['assign_private_ip'] = vm_['private_ip']
vm_.pop('private_ip')
return config.get_cloud_config_value(
'assign_private_ip', vm_, __opts__, default=False
)