mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #41641 from rallytime/merge-nitrogen
[nitrogen] Merge forward from 2016.11 to nitrogen
This commit is contained in:
commit
83cb447a96
@ -3151,7 +3151,7 @@ def is_profile_configured(opts, provider, profile_name, vm_=None):
|
||||
alias, driver = provider.split(':')
|
||||
|
||||
# Most drivers need an image to be specified, but some do not.
|
||||
non_image_drivers = ['nova', 'virtualbox', 'libvirt']
|
||||
non_image_drivers = ['nova', 'virtualbox', 'libvirt', 'softlayer']
|
||||
|
||||
# Most drivers need a size, but some do not.
|
||||
non_size_drivers = ['opennebula', 'parallels', 'proxmox', 'scaleway',
|
||||
|
@ -35,21 +35,6 @@ def __virtual__():
|
||||
return __virtualname__
|
||||
|
||||
|
||||
def _check_systemd_salt_config():
|
||||
conf = '/etc/sysctl.d/99-salt.conf'
|
||||
if not os.path.exists(conf):
|
||||
sysctl_dir = os.path.split(conf)[0]
|
||||
if not os.path.exists(sysctl_dir):
|
||||
os.makedirs(sysctl_dir)
|
||||
try:
|
||||
with salt.utils.fopen(conf, 'w'):
|
||||
pass
|
||||
except (IOError, OSError):
|
||||
msg = 'Could not create file: {0}'
|
||||
raise CommandExecutionError(msg.format(conf))
|
||||
return conf
|
||||
|
||||
|
||||
def default_config():
|
||||
'''
|
||||
Linux hosts using systemd 207 or later ignore ``/etc/sysctl.conf`` and only
|
||||
@ -65,7 +50,7 @@ def default_config():
|
||||
'''
|
||||
if salt.utils.systemd.booted(__context__) \
|
||||
and salt.utils.systemd.version(__context__) >= 207:
|
||||
return _check_systemd_salt_config()
|
||||
return '/etc/sysctl.d/99-salt.conf'
|
||||
return '/etc/sysctl.conf'
|
||||
|
||||
|
||||
@ -180,6 +165,9 @@ def persist(name, value, config=None):
|
||||
edited = False
|
||||
# If the sysctl.conf is not present, add it
|
||||
if not os.path.isfile(config):
|
||||
sysctl_dir = os.path.dirname(config)
|
||||
if not os.path.exists(sysctl_dir):
|
||||
os.makedirs(sysctl_dir)
|
||||
try:
|
||||
with salt.utils.fopen(config, 'w+') as _fh:
|
||||
_fh.write('#\n# Kernel sysctl configuration\n#\n')
|
||||
|
@ -335,6 +335,7 @@ def mod_run_check(cmd_kwargs, onlyif, unless, creates):
|
||||
# to quote problems
|
||||
cmd_kwargs = copy.deepcopy(cmd_kwargs)
|
||||
cmd_kwargs['use_vt'] = False
|
||||
cmd_kwargs['bg'] = False
|
||||
|
||||
if onlyif is not None:
|
||||
if isinstance(onlyif, string_types):
|
||||
|
Loading…
Reference in New Issue
Block a user