Skip to content

Commit fe770f6

Browse files
committed
Merge pull request #2 from saltstack/develop
Pull in latest upstream.
2 parents 8b58c58 + 3729ecb commit fe770f6

24 files changed

Lines changed: 542 additions & 172 deletions

File tree

‎doc/topics/releases/2014.1.2.rst‎

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,44 @@ Salt 2014.1.2 Release Notes
77
Version 2014.1.2 is another bugfix release for :doc:`2014.1.0
88
</topics/releases/2014.1.0>`. The changes include:
99

10-
- Fix username detection when su’ed to root on FreeBSD (:issue:`11628`)
10+
- Fix username detection when su'ed to root on FreeBSD (:issue:`11628`)
1111
- Fix minionfs backend for file.recurse states
1212
- Fix 32-bit packages of different arches than the CPU arch, on 32-bit
1313
RHEL/CentOS (:issue:`11822`)
1414
- Fix bug with specifying alternate home dir on user creation (FreeBSD)
1515
(:issue:`11790`)
16-
- Don’t reload “site” module on module refresh for MacOS
16+
- Don’t reload ``site`` module on module refresh for MacOS
1717
- Fix regression with running execution functions in Pillar SLS
1818
(:issue:`11453`)
1919
- Fix some modules missing from Windows installer
20-
- Fix traceback on eauth failure (:issue:`11293`)
2120
- Don’t log an error for yum commands that return nonzero exit status on
2221
non-failure (:issue:`11645`)
22+
- Fix bug in rabbitmq state (:issue:`8703`)
23+
- Fix missing ssh config options (:issue:`10604`)
24+
- Fix top.sls ordering (:issue:`10810` and :issue:`11691`)
25+
- Fix ``salt-key --list all`` (:issue:`10982`)
26+
- Fix win_servermanager install/remove function (:issue:`11038`)
27+
- Fix interaction with tokens when running commands as root (:issue:`11223`)
28+
- Fix overstate bug with ``find_job`` and ``**kwargs`` (:issue:`10503`)
29+
- Fix ``saltenv`` for ``aptpkg.mod_repo`` from ``pkgrepo`` state
30+
- Fix environment issue causing file caching problems (:issue:`11189`)
31+
- Fix bug in ``__parse_key`` in registry state (:issue:`11408`)
32+
- Add minion auth retry on rejection (:issue:`10763`)
33+
- Fix publish_session updating the encryption key (:issue:`11493`)
34+
- Fix for bad ``AssertionError`` raised by GitPython (:issue:`11473`)
35+
- Fix ``debian_ip`` to allow disabling and enabling networking on Ubuntu (:issue:`11164`)
36+
- Fix potential memory leak caused by saved (and unused) events (:issue:`11582`)
37+
- Fix exception handling in the MySQL module (:issue:`11616`)
38+
- Fix environment-related error (:issue:`11534`)
39+
- Include ``psutil`` on Windows
40+
- Add ``file.replace`` and ``file.search`` to Windows (:issue:`11471`)
41+
- Add additional ``file`` module helpers to Windows (:issue:`11235`)
42+
- Add ``pid`` to netstat output on Windows (:issue:`10782`)
43+
- Fix Windows not caching new versions of installers in winrepo (:issue:`10597`)
44+
- Fix hardcoded md5 hashing
45+
- Fix kwargs in salt-ssh (:issue:`11609`)
46+
- Fix file backup timestamps (:issue:`11745`)
47+
- Fix stacktrace on ``sys.doc`` with invalid eauth (:issue:`11293`)
48+
- Fix ``git.latest`` with ``test=True`` (:issue:`11595`)
49+
- Fix ``file.check_perms`` hardcoded ``follow_symlinks`` (:issue:`11387`)
50+
- Fix certain ``pkg`` states for RHEL5/Cent5 machines (:issue:`11719`)

‎salt/auth/ldap.py‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
HAS_LDAP = False
2525

2626
# Defaults, override in master config
27-
__defopts__ = {'auth.ldap.server': 'localhost',
27+
__defopts__ = {'auth.ldap.uri': '',
28+
'auth.ldap.server': 'localhost',
2829
'auth.ldap.port': '389',
2930
'auth.ldap.tls': False,
3031
'auth.ldap.no_verify': False,
@@ -66,38 +67,43 @@ class _LDAPConnection(object):
6667
Setup an LDAP connection.
6768
'''
6869

69-
def __init__(self, server, port, tls, no_verify, binddn, bindpw,
70+
def __init__(self, uri, server, port, tls, no_verify, binddn, bindpw,
7071
anonymous):
7172
'''
7273
Bind to an LDAP directory using passed credentials.
7374
'''
75+
self.uri = uri
7476
self.server = server
7577
self.port = port
7678
self.tls = tls
7779
self.binddn = binddn
7880
self.bindpw = bindpw
79-
schema = 'ldap'
8081
if not HAS_LDAP:
8182
raise CommandExecutionError('Failed to connect to LDAP, module '
8283
'not loaded')
84+
if self.uri == '':
85+
self.uri = 'ldap://{0}:{1}'.format(self.server, self.port)
86+
8387
try:
8488
if no_verify:
8589
ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT,
8690
ldap.OPT_X_TLS_NEVER)
87-
if self.tls:
88-
schema = 'ldaps'
91+
8992
self.ldap = ldap.initialize(
90-
'{0}://{1}:{2}'.format(schema, self.server, self.port)
93+
'{0}'.format(self.uri)
9194
)
9295
self.ldap.protocol_version = 3 # ldap.VERSION3
9396
self.ldap.set_option(ldap.OPT_REFERRALS, 0) # Needed for AD
9497

98+
if self.tls:
99+
self.ldap.start_tls_s()
100+
95101
if not anonymous:
96102
self.ldap.simple_bind_s(self.binddn, self.bindpw)
97103
except Exception as ldap_error:
98104
raise CommandExecutionError(
99-
'Failed to bind to LDAP server {0}:{1} as {2}: {3}'.format(
100-
self.server, self.port, self.binddn, ldap_error
105+
'Failed to bind to LDAP server {0} as {1}: {2}'.format(
106+
self.uri, self.binddn, ldap_error
101107
)
102108
)
103109

@@ -112,7 +118,7 @@ def _bind(username, password):
112118
connargs = {}
113119
# config params (auth.ldap.*)
114120
params = {
115-
'mandatory': ['server', 'port', 'tls', 'no_verify', 'anonymous'],
121+
'mandatory': ['uri', 'server', 'port', 'tls', 'no_verify', 'anonymous'],
116122
'additional': ['binddn', 'bindpw', 'filter'],
117123
}
118124

‎salt/cli/__init__.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ def run(self):
9292
'fun': self.config['fun'],
9393
'arg': self.config['arg'],
9494
'timeout': self.options.timeout,
95-
'show_timeout': self.options.show_timeout}
95+
'show_timeout': self.options.show_timeout,
96+
'show_jid': self.options.show_jid}
9697

9798
if 'token' in self.config:
9899
try:

‎salt/client/__init__.py‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,7 @@ def get_cli_returns(
724724
tgt='*',
725725
tgt_type='glob',
726726
verbose=False,
727+
show_jid=False,
727728
**kwargs):
728729
'''
729730
Starts a watcher looking at the return data for a specified JID
@@ -734,6 +735,8 @@ def get_cli_returns(
734735
msg = 'Executing job with jid {0}'.format(jid)
735736
print(msg)
736737
print('-' * len(msg) + '\n')
738+
elif show_jid:
739+
print('jid: {0}'.format(jid))
737740
if timeout is None:
738741
timeout = self.opts['timeout']
739742
fret = {}
@@ -1084,7 +1087,8 @@ def get_cli_static_event_returns(
10841087
timeout=None,
10851088
tgt='*',
10861089
tgt_type='glob',
1087-
verbose=False):
1090+
verbose=False,
1091+
show_jid=False):
10881092
'''
10891093
Get the returns for the command line interface via the event system
10901094
'''
@@ -1094,6 +1098,9 @@ def get_cli_static_event_returns(
10941098
msg = 'Executing job with jid {0}'.format(jid)
10951099
print(msg)
10961100
print('-' * len(msg) + '\n')
1101+
elif show_jid:
1102+
print('jid: {0}'.format(jid))
1103+
10971104
if timeout is None:
10981105
timeout = self.opts['timeout']
10991106
jid_dir = salt.utils.jid_dir(jid,
@@ -1159,6 +1166,7 @@ def get_cli_event_returns(
11591166
tgt_type='glob',
11601167
verbose=False,
11611168
show_timeout=False,
1169+
show_jid=False,
11621170
**kwargs):
11631171
'''
11641172
Get the returns for the command line interface via the event system
@@ -1174,6 +1182,9 @@ def get_cli_event_returns(
11741182
msg = 'Executing job with jid {0}'.format(jid)
11751183
print(msg)
11761184
print('-' * len(msg) + '\n')
1185+
elif show_jid:
1186+
print('jid: {0}'.format(jid))
1187+
11771188
if timeout is None:
11781189
timeout = self.opts['timeout']
11791190
jid_dir = salt.utils.jid_dir(jid,

‎salt/cloud/clouds/botocore_aws.py‎

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,21 @@
3838
# Import salt.cloud libs
3939
import salt.config as config
4040
from salt.utils import namespaced_function
41-
from salt.cloud.libcloudfuncs import * # pylint: disable=W0614,W0401
4241
from salt.cloud.exceptions import SaltCloudException, SaltCloudSystemExit
4342

4443
# Import libcloudfuncs and libcloud_aws, required to latter patch __opts__
45-
from salt.cloud import libcloudfuncs
46-
from salt.cloud.clouds import libcloud_aws
47-
# Import libcloud_aws, storing pre and post locals so we can namespace any
48-
# callable to this module.
49-
PRE_IMPORT_LOCALS_KEYS = locals().copy()
50-
from salt.cloud.clouds.libcloud_aws import * # pylint: disable=W0614,W0401
51-
POST_IMPORT_LOCALS_KEYS = locals().copy()
44+
try:
45+
from salt.cloud.libcloudfuncs import * # pylint: disable=W0614,W0401
46+
from salt.cloud import libcloudfuncs
47+
from salt.cloud.clouds import libcloud_aws
48+
# Import libcloud_aws, storing pre and post locals so we can namespace any
49+
# callable to this module.
50+
PRE_IMPORT_LOCALS_KEYS = locals().copy()
51+
from salt.cloud.clouds.libcloud_aws import * # pylint: disable=W0614,W0401
52+
POST_IMPORT_LOCALS_KEYS = locals().copy()
53+
HAS_LIBCLOUD = True
54+
except ImportError:
55+
HAS_LIBCLOUD = False
5256

5357
# Get logging started
5458
log = logging.getLogger(__name__)
@@ -62,6 +66,9 @@ def __virtual__():
6266
'''
6367
Set up the libcloud funcstions and check for AWS configs
6468
'''
69+
if not HAS_LIBCLOUD:
70+
return False
71+
6572
try:
6673
# Import botocore
6774
import botocore.session

‎salt/cloud/clouds/ec2.py‎

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
# Import salt.cloud libs
8989
import salt.utils.cloud
9090
import salt.config as config
91-
from salt.cloud.libcloudfuncs import * # pylint: disable=W0614,W0401
9291
from salt.cloud.exceptions import (
9392
SaltCloudException,
9493
SaltCloudSystemExit,
@@ -119,21 +118,19 @@
119118

120119

121120
EC2_LOCATIONS = {
122-
'ap-northeast-1': Provider.EC2_AP_NORTHEAST,
123-
'ap-southeast-1': Provider.EC2_AP_SOUTHEAST,
124-
'eu-west-1': Provider.EC2_EU_WEST,
125-
'sa-east-1': Provider.EC2_SA_EAST,
126-
'us-east-1': Provider.EC2_US_EAST,
127-
'us-west-1': Provider.EC2_US_WEST,
128-
'us-west-2': Provider.EC2_US_WEST_OREGON
121+
'ap-northeast-1': 'ec2_ap_northeast',
122+
'ap-southeast-1': 'ec2_ap_southeast',
123+
'ap-southeast-2': 'ec2_ap_southeast_2',
124+
'eu-west-1': 'ec2_eu_west',
125+
'sa-east-1': 'ec2_sa_east',
126+
'us-east-1': 'ec2_us_east',
127+
'us-west-1': 'ec2_us_west',
128+
'us-west-2': 'ec2_us_west_oregon',
129129
}
130130
DEFAULT_LOCATION = 'us-east-1'
131131

132132
DEFAULT_EC2_API_VERSION = '2013-10-01'
133133

134-
if hasattr(Provider, 'EC2_AP_SOUTHEAST2'):
135-
EC2_LOCATIONS['ap-southeast-2'] = Provider.EC2_AP_SOUTHEAST2
136-
137134
EC2_RETRY_CODES = [
138135
'RequestLimitExceeded',
139136
'InsufficientInstanceCapacity',
@@ -1999,6 +1996,7 @@ def get_tags(name=None,
19991996
instance_id=None,
20001997
call=None,
20011998
location=None,
1999+
kwargs=None,
20022000
resource_id=None): # pylint: disable=W0613
20032001
'''
20042002
Retrieve tags for a resource. Normally a VM name or instance_id is passed
@@ -2010,14 +2008,19 @@ def get_tags(name=None,
20102008
salt-cloud -a get_tags mymachine
20112009
salt-cloud -a get_tags resource_id=vol-3267ab32
20122010
'''
2013-
if instance_id is None:
2014-
if location is None:
2015-
location = get_location()
2011+
if location is None:
2012+
location = get_location()
20162013

2014+
if instance_id is None:
20172015
if resource_id is None:
2018-
instances = list_nodes_full(location)
2019-
if name in instances:
2020-
instance_id = instances[name]['instanceId']
2016+
if name:
2017+
instances = list_nodes_full(location)
2018+
if name in instances:
2019+
instance_id = instances[name]['instanceId']
2020+
elif 'instance_id' in kwargs:
2021+
instance_id = kwargs['instance_id']
2022+
elif 'resource_id' in kwargs:
2023+
instance_id = kwargs['resource_id']
20212024
else:
20222025
instance_id = resource_id
20232026

‎salt/cloud/clouds/gce.py‎

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,18 @@
122122
_UA_VERSION = '0.2.0'
123123

124124
# The import section is mostly libcloud boilerplate
125-
from libcloud.compute.types import Provider
126-
from libcloud.compute.providers import get_driver
127-
from libcloud.loadbalancer.types import Provider as Provider_lb
128-
from libcloud.loadbalancer.providers import get_driver as get_driver_lb
129-
from libcloud.common.google import (
130-
ResourceInUseError,
131-
ResourceNotFoundError,
132-
)
125+
try:
126+
from libcloud.compute.types import Provider
127+
from libcloud.compute.providers import get_driver
128+
from libcloud.loadbalancer.types import Provider as Provider_lb
129+
from libcloud.loadbalancer.providers import get_driver as get_driver_lb
130+
from libcloud.common.google import (
131+
ResourceInUseError,
132+
ResourceNotFoundError,
133+
)
134+
HAS_LIBCLOUD = True
135+
except ImportError:
136+
HAS_LIBCLOUD = False
133137

134138
# Import python libs
135139
import copy
@@ -170,6 +174,9 @@ def __virtual__():
170174
'''
171175
Set up the libcloud functions and check for GCE configurations.
172176
'''
177+
if not HAS_LIBCLOUD:
178+
return False
179+
173180
if get_configured_provider() is False:
174181
return False
175182

0 commit comments

Comments
 (0)