Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
* upstream/develop: (25 commits)
  Support using private IPs (without pubic IPs) (saltstack#34187)
  Add 'delete' key event to list (saltstack#34189)
  Don't return bytes if py3 in salt-cloud (saltstack#34105)
  Raise the correct exception when gitfs lockfile is empty
  Remove unnecesssary comment
  Fix diskusage beacon
  fix salt --summary to count not responding minions correctly (saltstack#34165)
  doc: add missing dot (saltstack#34175)
  Typo fix (saltstack#34174)
  Update docs to match log_level warning default
  Fix YAML indentation in Apache state docstrings (saltstack#34166)
  Add integration tests for grains.append
  Moved imports to top, out of _get_moto_version function
  Updated version check. Moved check into it's own function
  Move log message from INFO to DEBUG.
  Updated test to work with new moto version. Changed strings to unicode
  Update package dep note to systemd-python for RHEL7 install
  _active_mounts_openbsd: unbreak output for special filesystems
  Make docker.absent honor test=true
  When specifying the SSH identity to use with Git as a salt URL, eg. salt://files/identity, if that file exists outside of the default base environment the file won't be accessible so we need to include the saltenv.
  ...

# Conflicts:
#	salt/states/git.py
  • Loading branch information
jojohans committed Jun 22, 2016
2 parents ced6092 + 24ca086 commit 409b404
Show file tree
Hide file tree
Showing 20 changed files with 376 additions and 89 deletions.
2 changes: 1 addition & 1 deletion doc/ref/cli/salt-call.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Options

.. include:: _includes/logging-options.rst
.. |logfile| replace:: /var/log/salt/minion
.. |loglevel| replace:: ``info``
.. |loglevel| replace:: ``warning``

.. include:: _includes/output-options.rst

Expand Down
2 changes: 1 addition & 1 deletion doc/ref/configuration/logging/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Examples:
``log_level``
-------------

Default: ``info``
Default: ``warning``

The level of log record messages to send to the console.
One of ``all``, ``garbage``, ``trace``, ``debug``, ``info``, ``warning``,
Expand Down
2 changes: 1 addition & 1 deletion doc/ref/configuration/minion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ Examples:
``log_level``
-------------

Default: ``info``
Default: ``warning``

The level of messages to send to the console. See also :conf_log:`log_level`.

Expand Down
2 changes: 1 addition & 1 deletion doc/topics/event/master_events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Key events

:var id: The minion ID.
:var act: The new status of the minion key: ``accept``, ``pend``,
``reject``.
``reject``, ``delete``.

.. warning:: If a master is in :conf_master:`auto_accept mode`, ``salt/key`` events
will not be fired when the keys are accepted. In addition, pre-seeding
Expand Down
2 changes: 1 addition & 1 deletion doc/topics/installation/rhel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ the SaltStack Repository.
https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/base/RPM-GPG-KEY-CentOS-7
.. note::
``systemd`` and ``python-systemd`` are required by Salt, but are not
``systemd`` and ``systemd-python`` are required by Salt, but are not
installed by the Red Hat 7 ``@base`` installation or by the Salt
installation. These dependencies might need to be installed before Salt.

Expand Down
41 changes: 32 additions & 9 deletions salt/cloud/clouds/azurearm.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,14 @@ def list_ip_configurations(call=None, kwargs=None): # pylint: disable=unused-ar
'''
List IP configurations
'''
global netconn # pylint: disable=global-statement,invalid-name
if not netconn:
netconn = get_conn(NetworkManagementClient,
NetworkManagementClientConfiguration)

if kwargs is None:
kwargs = {}

if 'group' not in kwargs:
if 'resource_group' in kwargs:
kwargs['group'] = kwargs['resource_group']
Expand Down Expand Up @@ -722,7 +730,10 @@ def list_interfaces(call=None, kwargs=None): # pylint: disable=unused-argument

if kwargs.get('resource_group') is None:
kwargs['resource_group'] = config.get_cloud_config_value(
'resource_group', {}, __opts__, search_global=True
'resource_group', {}, __opts__, search_global=True,
default=config.get_cloud_config_value(
'group', {}, __opts__, search_global=True
)
)

region = get_location()
Expand Down Expand Up @@ -790,7 +801,8 @@ def create_interface(call=None, kwargs=None): # pylint: disable=unused-argument
)

ip_kwargs = {}
if bool(kwargs.get('public_ip', False)) is True:
ip_configurations = None
if bool(kwargs.get('public_ip')) is True:
pub_ip_name = '{0}-ip'.format(kwargs['iface_name'])
poller = netconn.public_ip_addresses.create_or_update(
resource_group_name=kwargs['resource_group'],
Expand All @@ -812,30 +824,41 @@ def create_interface(call=None, kwargs=None): # pylint: disable=unused-argument
ip_kwargs['public_ip_address'] = Resource(
str(pub_ip_data.id), # pylint: disable=no-member
)
ip_configurations = [
NetworkInterfaceIPConfiguration(
name='{0}-ip'.format(kwargs['iface_name']),
private_ip_allocation_method='Dynamic',
subnet=subnet_obj,
**ip_kwargs
)
]
break
except CloudError:
pass
count += 1
if count > 120:
raise ValueError('Timed out waiting for public IP Address.')
time.sleep(5)

iface_params = NetworkInterface(
name=kwargs['iface_name'],
location=kwargs['location'],
ip_configurations=[
else:
priv_ip_name = '{0}-ip'.format(kwargs['iface_name'])
ip_configurations = [
NetworkInterfaceIPConfiguration(
name='{0}-ip'.format(kwargs['iface_name']),
private_ip_allocation_method='Dynamic',
subnet=subnet_obj,
**ip_kwargs
)
]

iface_params = NetworkInterface(
name=kwargs['iface_name'],
location=kwargs['location'],
ip_configurations=ip_configurations,
)

netconn.network_interfaces.create_or_update(
poller = netconn.network_interfaces.create_or_update(
kwargs['resource_group'], kwargs['iface_name'], iface_params
)
poller.wait()
count = 0
while True:
try:
Expand Down
34 changes: 18 additions & 16 deletions salt/cloud/libcloudfuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def avail_locations(conn=None, call=None):
locations = conn.list_locations()
ret = {}
for img in locations:
if isinstance(img.name, string_types):
if isinstance(img.name, string_types) and not six.PY3:
img_name = img.name.encode('ascii', 'salt-cloud-force-ascii')
else:
img_name = str(img.name)
Expand All @@ -154,7 +154,7 @@ def avail_locations(conn=None, call=None):
continue

attr_value = getattr(img, attr)
if isinstance(attr_value, string_types):
if isinstance(attr_value, string_types) and not six.PY3:
attr_value = attr_value.encode(
'ascii', 'salt-cloud-force-ascii'
)
Expand All @@ -180,7 +180,7 @@ def avail_images(conn=None, call=None):
images = conn.list_images()
ret = {}
for img in images:
if isinstance(img.name, string_types):
if isinstance(img.name, string_types) and not six.PY3:
img_name = img.name.encode('ascii', 'salt-cloud-force-ascii')
else:
img_name = str(img.name)
Expand All @@ -190,7 +190,7 @@ def avail_images(conn=None, call=None):
if attr.startswith('_'):
continue
attr_value = getattr(img, attr)
if isinstance(attr_value, string_types):
if isinstance(attr_value, string_types) and not six.PY3:
attr_value = attr_value.encode(
'ascii', 'salt-cloud-force-ascii'
)
Expand All @@ -215,7 +215,7 @@ def avail_sizes(conn=None, call=None):
sizes = conn.list_sizes()
ret = {}
for size in sizes:
if isinstance(size.name, string_types):
if isinstance(size.name, string_types) and not six.PY3:
size_name = size.name.encode('ascii', 'salt-cloud-force-ascii')
else:
size_name = str(size.name)
Expand All @@ -230,7 +230,7 @@ def avail_sizes(conn=None, call=None):
except Exception:
pass

if isinstance(attr_value, string_types):
if isinstance(attr_value, string_types) and not six.PY3:
attr_value = attr_value.encode(
'ascii', 'salt-cloud-force-ascii'
)
Expand All @@ -243,17 +243,19 @@ def get_location(conn, vm_):
Return the location object to use
'''
locations = conn.list_locations()
vm_location = config.get_cloud_config_value('location', vm_, __opts__).encode(
'ascii', 'salt-cloud-force-ascii'
)
vm_location = config.get_cloud_config_value('location', vm_, __opts__)
if not six.PY3:
vm_location = vm_location.encode(
'ascii', 'salt-cloud-force-ascii'
)

for img in locations:
if isinstance(img.id, string_types):
if isinstance(img.id, string_types) and not six.PY3:
img_id = img.id.encode('ascii', 'salt-cloud-force-ascii')
else:
img_id = str(img.id)

if isinstance(img.name, string_types):
if isinstance(img.name, string_types) and not six.PY3:
img_name = img.name.encode('ascii', 'salt-cloud-force-ascii')
else:
img_name = str(img.name)
Expand All @@ -273,18 +275,18 @@ def get_image(conn, vm_):
Return the image object to use
'''
images = conn.list_images()
vm_image = config.get_cloud_config_value('image', vm_, __opts__)

vm_image = config.get_cloud_config_value('image', vm_, __opts__).encode(
'ascii', 'salt-cloud-force-ascii'
)
if not six.PY3:
vm_image = vm_image.encode('ascii', 'salt-cloud-force-ascii')

for img in images:
if isinstance(img.id, string_types):
if isinstance(img.id, string_types) and not six.PY3:
img_id = img.id.encode('ascii', 'salt-cloud-force-ascii')
else:
img_id = str(img.id)

if isinstance(img.name, string_types):
if isinstance(img.name, string_types) and not six.PY3:
img_name = img.name.encode('ascii', 'salt-cloud-force-ascii')
else:
img_name = str(img.name)
Expand Down
2 changes: 1 addition & 1 deletion salt/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2917,7 +2917,7 @@ def get_id(opts, cache_minion_id=False):

newid = salt.utils.network.generate_minion_id()
if '__role' in opts and opts.get('__role') == 'minion':
log.info('Found minion id from generate_minion_id(): {0}'.format(newid))
log.debug('Found minion id from generate_minion_id(): {0}'.format(newid))
if cache_minion_id and opts.get('minion_id_caching', True):
_cache_id(newid, id_cache)
is_ipv4 = newid.count('.') == 3 and not any(c.isalpha() for c in newid)
Expand Down
Loading

0 comments on commit 409b404

Please sign in to comment.