Skip to content

Commit

Permalink
Merge pull request #34553 from rallytime/merge-2016.3
Browse files Browse the repository at this point in the history
[2016.3] Merge forward from 2015.8 to 2016.3
  • Loading branch information
Nicole Thomas committed Jul 11, 2016
2 parents 5b002e1 + 815c8b3 commit d8c8b4a
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 20 deletions.
48 changes: 40 additions & 8 deletions salt/cloud/deploy/bootstrap-salt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
#======================================================================================================================
set -o nounset # Treat unset variables as an error

__ScriptVersion="2016.06.27"
__ScriptVersion="2016.07.07"
__ScriptName="bootstrap-salt.sh"

__ScriptFullName="${0}"
__ScriptArgs="${*}"
__ScriptFullName="$0"
__ScriptArgs="$*"

#======================================================================================================================
# Environment variables taken into account.
Expand Down Expand Up @@ -630,7 +630,7 @@ fi

echoinfo "Running version: ${__ScriptVersion}"
echoinfo "Executed by: ${CALLER}"
echoinfo "Command line: \"${__ScriptFullName} ${__ScriptArgs}\""
echoinfo "Command line: '${__ScriptFullName} ${__ScriptArgs}'"
#echowarn "Running the unstable version of ${__ScriptName}"

#--- FUNCTION -------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -1180,6 +1180,7 @@ __ubuntu_derivatives_translation() {

linuxmint_16_ubuntu_base="13.10"
linuxmint_17_ubuntu_base="14.04"
linuxmint_18_ubuntu_base="16.04"
linaro_12_ubuntu_base="12.04"
elementary_os_02_ubuntu_base="12.04"

Expand Down Expand Up @@ -2366,6 +2367,11 @@ install_ubuntu_stable_deps() {
set -o nounset
fi

# Make sure https transport is available
if [ "$HTTP_VAL" = "https" ] ; then
__apt_get_install_noinput ca-certificates apt-transport-https || return 1
fi

# Make sure wget is available
__apt_get_install_noinput wget

Expand Down Expand Up @@ -2714,6 +2720,8 @@ install_debian_7_deps() {
if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then
if [ "$CPU_ARCH_L" = "amd64" ] || [ "$CPU_ARCH_L" = "x86_64" ]; then
repo_arch="amd64"
elif [ "$CPU_ARCH_L" = "armv7l" ]; then
repo_arch="armhf"
elif [ "$CPU_ARCH_L" = "i386" ] || [ "$CPU_ARCH_L" = "i686" ]; then
echoerror "repo.saltstack.com likely doesn't have 32-bit packages for Debian (yet?)"
repo_arch="i386"
Expand Down Expand Up @@ -2790,6 +2798,8 @@ install_debian_8_deps() {
if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then
if [ "$CPU_ARCH_L" = "amd64" ] || [ "$CPU_ARCH_L" = "x86_64" ]; then
repo_arch="amd64"
elif [ "$CPU_ARCH_L" = "armv7l" ]; then
repo_arch="armhf"
elif [ "$CPU_ARCH_L" = "i386" ] || [ "$CPU_ARCH_L" = "i686" ]; then
echoerror "repo.saltstack.com likely doesn't have 32-bit packages for Debian (yet?)"
repo_arch="i386"
Expand Down Expand Up @@ -3113,7 +3123,13 @@ install_fedora_deps() {
__install_saltstack_copr_salt_repository || return 1
fi

__PACKAGES="yum-utils PyYAML libyaml m2crypto python-crypto python-jinja2 python-msgpack python-zmq python-requests"
__PACKAGES="yum-utils PyYAML libyaml m2crypto python-crypto python-jinja2 python-zmq"

if [ "$DISTRO_MAJOR_VERSION" -ge 23 ]; then
__PACKAGES="${__PACKAGES} python2-msgpack python2-requests"
else
__PACKAGES="${__PACKAGES} python-msgpack python-requests"
fi

if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then
__PACKAGES="${__PACKAGES} python-libcloud"
Expand Down Expand Up @@ -4082,6 +4098,14 @@ _eof
}

install_amazon_linux_ami_git_deps() {

# When installing from git, this variable might not be set yet for amazon linux. Set this
# to "latest" in order to set up the SaltStack repository and avoid a malformed baseurl
# and gpgkey reference in the install_amazon_linux_amI_deps function.
if [ "$STABLE_REV" = "" ]; then
STABLE_REV="latest"
fi

install_amazon_linux_ami_deps || return 1

if ! __check_command_exists git; then
Expand All @@ -4098,7 +4122,6 @@ install_amazon_linux_ami_git_deps() {
fi
fi


# Let's trigger config_salt()
if [ "$_TEMP_CONFIG_DIR" = "null" ]; then
_TEMP_CONFIG_DIR="${_SALT_GIT_CHECKOUT_DIR}/conf/"
Expand Down Expand Up @@ -4410,7 +4433,7 @@ __configure_freebsd_pkg_details() {
echo " url: \"${SALTPKGCONFURL}\","
echo " mirror_type: \"http\","
echo " enabled: true"
echo " prioroity: 10"
echo " priority: 10"
echo "}"
} > $salt_conf_file
FROM_SALTSTACK="-r SaltStack"
Expand Down Expand Up @@ -5204,7 +5227,16 @@ install_opensuse_git_post() {
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue

if [ -f /bin/systemctl ]; then
use_usr_lib=$BS_FALSE
if [ "${DISTRO_MAJOR_VERSION}" -gt 13 ] || ([ "${DISTRO_MAJOR_VERSION}" -eq 13 ] && [ "${DISTRO_MINOR_VERSION}" -ge 2 ]); then
use_usr_lib=$BS_TRUE
fi

if [ "${DISTRO_MAJOR_VERSION}" -eq 12 ] && [ -d "/usr/lib/systemd/" ]; then
use_usr_lib=$BS_TRUE
fi

if [ "${use_usr_lib}" -eq $BS_TRUE ]; then
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" "/usr/lib/systemd/system/salt-${fname}.service"
else
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service"
Expand Down Expand Up @@ -5371,7 +5403,7 @@ install_suse_12_stable_deps() {
}

install_suse_12_git_deps() {
install_suse_11_stable_deps || return 1
install_suse_12_stable_deps || return 1

if ! __check_command_exists git; then
__zypper_install git || return 1
Expand Down
2 changes: 1 addition & 1 deletion salt/modules/influx.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def retention_policy_exists(database,
salt '*' influxdb.retention_policy_exists metrics default
'''
policy = retention_policy_get(name, database, user, password, host, port)
policy = retention_policy_get(database, name, user, password, host, port)
return policy is not None


Expand Down
28 changes: 24 additions & 4 deletions tests/integration/loader/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from salt.config import minion_config
# pylint: enable=no-name-in-module,redefined-builtin

from salt.loader import LazyLoader, _module_dirs, grains
from salt.loader import LazyLoader, _module_dirs, grains, utils, proxy, minion_mods

loader_template = '''
import os
Expand Down Expand Up @@ -249,9 +249,15 @@ def setUp(self):

dirs = _module_dirs(self.opts, 'modules', 'module')
dirs.append(self.tmp_dir)
self.utils = utils(self.opts)
self.proxy = proxy(self.opts)
self.minion_mods = minion_mods(self.opts)
self.loader = LazyLoader(dirs,
self.opts,
tag='module')
tag='module',
pack={'__utils__': self.utils,
'__proxy__': self.proxy,
'__salt__': self.minion_mods})

def tearDown(self):
shutil.rmtree(self.tmp_dir)
Expand Down Expand Up @@ -376,9 +382,16 @@ def setUp(self):

dirs = _module_dirs(self.opts, 'modules', 'module')
dirs.append(self.tmp_dir)
self.utils = utils(self.opts)
self.proxy = proxy(self.opts)
self.minion_mods = minion_mods(self.opts)
self.loader = LazyLoader(dirs,
self.opts,
tag='module')
tag='module',
pack={'__utils__': self.utils,
'__proxy__': self.proxy,
'__salt__': self.minion_mods}
)

def tearDown(self):
shutil.rmtree(self.tmp_dir)
Expand Down Expand Up @@ -620,9 +633,16 @@ def setUp(self):

dirs = _module_dirs(self.opts, 'modules', 'module')
dirs.append(self.tmp_dir)
self.utils = utils(self.opts)
self.proxy = proxy(self.opts)
self.minion_mods = minion_mods(self.opts)
self.loader = LazyLoader(dirs,
self.opts,
tag='module')
tag='module',
pack={'__utils__': self.utils,
'__proxy__': self.proxy,
'__salt__': self.minion_mods}
)

@property
def module_dir(self):
Expand Down
21 changes: 14 additions & 7 deletions tests/integration/states/pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,16 +567,23 @@ def test_pkg_012_latest_only_upgrade(self, grains=None):

# Now look for updates and try to run the state on a package which is
# already up-to-date.
installed_pkgs = self.run_function('pkg.list_pkgs')
updates = self.run_function('pkg.list_upgrades', refresh=False)
try:
target = next(iter(updates))
except StopIteration:

for pkgname in updates:
if pkgname in installed_pkgs:
target = pkgname
break
else:
target = ''
log.warning(
'No available upgrades, skipping only_upgrade=True test with '
'already-installed package. For best results run this test '
'on a machine with upgrades available.'
'No available upgrades to installed packages, skipping '
'only_upgrade=True test with already-installed package. For '
'best results run this test on a machine with upgrades '
'available.'
)
else:

if target:
ret = self.run_state('pkg.latest', name=target, refresh=False,
only_upgrade=True)
self.assertSaltTrueReturn(ret)
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit d8c8b4a

Please sign in to comment.