mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Merge branch 'develop' into salt-cloud-libvirt-tweaks
This commit is contained in:
commit
b08ddbb6d9
@ -3182,7 +3182,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',
|
||||
|
@ -22,7 +22,6 @@ import time
|
||||
|
||||
# Import salt libs
|
||||
import salt.utils
|
||||
import salt.syspaths
|
||||
from salt.exceptions import SaltInvocationError
|
||||
from salt.utils.versions import LooseVersion as _LooseVersion
|
||||
|
||||
@ -133,7 +132,7 @@ def _get_user_gnupghome(user):
|
||||
Return default GnuPG home directory path for a user
|
||||
'''
|
||||
if user == 'salt':
|
||||
gnupghome = os.path.join(salt.syspaths.CONFIG_DIR, 'gpgkeys')
|
||||
gnupghome = os.path.join(__salt__['config.get']('config_dir'), 'gpgkeys')
|
||||
else:
|
||||
gnupghome = os.path.join(_get_user_info(user)['home'], '.gnupg')
|
||||
|
||||
@ -929,7 +928,7 @@ def trust_key(keyid=None,
|
||||
_user = user
|
||||
|
||||
if user == 'salt':
|
||||
homeDir = os.path.join(salt.syspaths.CONFIG_DIR, 'gpgkeys')
|
||||
homeDir = os.path.join(__salt__['config.get']('config_dir'), 'gpgkeys')
|
||||
cmd.extend([' --homedir', homeDir])
|
||||
_user = 'root'
|
||||
res = __salt__['cmd.run_all'](cmd,
|
||||
|
27
tests/unit/modules/test_pyroute2.py
Normal file
27
tests/unit/modules/test_pyroute2.py
Normal file
@ -0,0 +1,27 @@
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from tests.support.unit import TestCase
|
||||
from tests.support.unit import skipIf
|
||||
from salt.beacons.network_settings import ATTRS
|
||||
try:
|
||||
from pyroute2 import IPDB
|
||||
HAS_PYROUTE2 = True
|
||||
except ImportError:
|
||||
HAS_PYROUTE2 = False
|
||||
|
||||
|
||||
@skipIf(not HAS_PYROUTE2, 'no pyroute2 installed, skipping')
|
||||
class Pyroute2TestCase(TestCase):
|
||||
|
||||
def test_interface_dict_fields(self):
|
||||
with IPDB() as ipdb:
|
||||
for attr in ATTRS:
|
||||
# ipdb.interfaces is a dict-like object, that
|
||||
# contains interface definitions. Interfaces can
|
||||
# be referenced both with indices and names.
|
||||
#
|
||||
# ipdb.interfaces[1] is an interface with index 1,
|
||||
# that is the loopback interface.
|
||||
self.assertIn(attr, ipdb.interfaces[1])
|
Loading…
Reference in New Issue
Block a user