commit salt for openSUSE:Factory
![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package salt for openSUSE:Factory checked in at 2014-07-31 10:04:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/salt (Old) and /work/SRC/openSUSE:Factory/.salt.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "salt" Changes: -------- --- /work/SRC/openSUSE:Factory/salt/salt.changes 2014-07-25 12:27:54.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.salt.new/salt.changes 2014-07-31 10:04:38.000000000 +0200 @@ -1,0 +2,11 @@ +Wed Jul 30 20:22:09 UTC 2014 - aboe76@gmail.com + +- Updated to 2014.1.8: + + Ensure salt-ssh will not continue if permissions on a temporary directory are not correct. + + Use the bootstrap script distributed with Salt instead of relying on an external resource + + Remove unused testing code + + Ensure salt states are placed into the .salt directory in salt-ssh + + Use a randomized path for temporary files in a salt-cloud deployment + + Clean any stale directories to ensure a fresh copy of salt-ssh during a deployment + +------------------------------------------------------------------- Old: ---- salt-2014.1.7.tar.gz New: ---- salt-2014.1.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ salt.spec ++++++ --- /var/tmp/diff_new_pack.c7tU4M/_old 2014-07-31 10:04:40.000000000 +0200 +++ /var/tmp/diff_new_pack.c7tU4M/_new 2014-07-31 10:04:40.000000000 +0200 @@ -17,7 +17,7 @@ Name: salt -Version: 2014.1.7 +Version: 2014.1.8 Release: 0 Summary: A parallel remote execution system License: Apache-2.0 ++++++ salt-2014.1.7.tar.gz -> salt-2014.1.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/PKG-INFO new/salt-2014.1.8/PKG-INFO --- old/salt-2014.1.7/PKG-INFO 2014-07-09 23:02:13.000000000 +0200 +++ new/salt-2014.1.8/PKG-INFO 2014-07-30 21:56:06.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: salt -Version: 2014.1.7 +Version: 2014.1.8 Summary: Portable, distributed, remote execution and configuration management system Home-page: http://saltstack.org Author: Thomas S Hatch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/doc/topics/releases/2014.1.8.rst new/salt-2014.1.8/doc/topics/releases/2014.1.8.rst --- old/salt-2014.1.7/doc/topics/releases/2014.1.8.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/salt-2014.1.8/doc/topics/releases/2014.1.8.rst 2014-07-30 21:48:40.000000000 +0200 @@ -0,0 +1,18 @@ +=========================== +Salt 2014.1.8 Release Notes +=========================== + +:release: 2014-07-30 + +Version 2014.1.8 is another bugfix release for :doc:`2014.1.0 +</topics/releases/2014.1.0>`. Changes include: + +- Ensure salt-ssh will not continue if permissions on a temporary directory are + not correct. +- Use the bootstrap script distributed with Salt instead of relying on an + external resource +- Remove unused testing code +- Ensure salt states are placed into the ``.salt`` directory in salt-ssh +- Use a randomized path for temporary files in a salt-cloud deployment +- Clean any stale directories to ensure a fresh copy of salt-ssh during a + deployment diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/pkg/smartos/esky/BUILD_ENVIRONMENT.md new/salt-2014.1.8/pkg/smartos/esky/BUILD_ENVIRONMENT.md --- old/salt-2014.1.7/pkg/smartos/esky/BUILD_ENVIRONMENT.md 2014-06-24 22:07:36.000000000 +0200 +++ new/salt-2014.1.8/pkg/smartos/esky/BUILD_ENVIRONMENT.md 2014-07-29 18:03:05.000000000 +0200 @@ -13,7 +13,7 @@ mv /opt/local /opt/local.backup ; hash -r cd / -curl http://pkgsrc.joyent.com/packages/SmartOS/bootstrap/bootstrap-2013Q3-x86_64.... | gtar xz +curl http://pkgsrc.joyent.com/packages/SmartOS/bootstrap/bootstrap-2013Q4-x86_64.... | gtar xz hash -r pkgin -y up @@ -23,13 +23,8 @@ cd /opt/local/bin curl -kO 'https://us-east.manta.joyent.com/nahamu/public/smartos/bins/patchelf' chmod +x patchelf -cat >swig <<"EOF" -#!/bin/bash -exec /opt/local/bin/swig2.0 -I/opt/local/include "$@" -EOF -pip install esky -yes | pip uninstall bbfreeze +pip install esky bbfreeze cd $HERE curl -kO 'https://pypi.python.org/packages/source/b/bbfreeze-loader/bbfreeze-loader-1....' @@ -41,16 +36,17 @@ gcc $HERE/console.o $HERE/getpath.o /opt/local/lib/python2.7/config/libpython2.7.a -L/opt/local/lib -L/opt/local/lib/python2.7/config -L/opt/local/lib -lsocket -lnsl -ldl -lrt -lm -static-libgcc -o $HERE/console.exe patchelf --set-rpath '$ORIGIN:$ORIGIN/../lib' $HERE/console.exe -git clone git://github.com/schmir/bbfreeze -b master -( cd $HERE/bbfreeze && easy_install-2.7 . ) find /opt/local -name console.exe -exec mv $HERE/console.exe {} \; -git clone git://github.com/saltstack/salt -b 0.17 -( cd $HERE/salt && python2.7 setup.py bdist && python2.7 setup.py bdist_esky ) - -mv /opt/local /opt/local.build ; hash -r -mv /opt/local.backup /opt/local ; hash -r +git clone git://github.com/saltstack/salt -b 2014.1 +cd $HERE/salt +pip install -r requirements.txt +# packages not in main requirements file that are nice to have +pip install -r pkg/smartos/esky/requirements.txt +bash pkg/smartos/esky/build-tarball.sh +# Upload packages into Manta +pkgin -y in sdc-manta mmkdir -p /$MANTA_USER/public/salt -mput /$MANTA_USER/public/salt -f $(ls salt/dist/*.zip) +for file in dist/salt*; do mput -m /$MANTA_USER/public/salt -f $file; done; ``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/pkg/smartos/esky/install.sh new/salt-2014.1.8/pkg/smartos/esky/install.sh --- old/salt-2014.1.7/pkg/smartos/esky/install.sh 2014-06-24 22:07:36.000000000 +0200 +++ new/salt-2014.1.8/pkg/smartos/esky/install.sh 2014-07-29 18:03:05.000000000 +0200 @@ -2,17 +2,50 @@ HERE=$(dirname $0) TOP=$(cd $HERE/.. ; pwd) +OUTPUT=$HERE/output +GZ_SMF=/opt/custom/smf +MASTER=$1 -mkdir $HERE/output +# process the manifests +mkdir $OUTPUT for file in $HERE/*.xml do - sed "s#SALT_PREFIX#$TOP#" <$file >$HERE/output/$(basename $file) - svccfg import $HERE/output/$(basename $file) + sed "s#SALT_PREFIX#$TOP#" <$file >$OUTPUT/$(basename $file) done -rm -rf $HERE/output -echo "To enable services, invoke any of" -echo " svcadm enable salt-minion" -echo " svcadm enable salt-master" -echo " svcadm enable salt-syndic" -echo "as appropriate" +# detect global or non-global zone +if [[ $(zonename) == global ]] +then + # we assume global zones are always minions only + # and we assume that they want to have the service come back on reboot + mkdir -p $GZ_SMF + sed 's/false/true/' < $OUTPUT/salt-minion.xml > $GZ_SMF/salt-minion.xml + svccfg import $OUTPUT/salt-minion.xml + echo "Minion is set to be launched at boot" +else + # non global zones get all three services imported + # and the user can enable whichever ones they want + for file in $OUTPUT/*.xml + do + svccfg import $file + done + echo "To enable master service, invoke either of" + echo " svcadm enable salt-master" + echo " svcadm enable salt-syndic" + echo "as appropriate" +fi + +# if the user provided the name of the master as an argument +# configure a minimal minion file and start the minion +if [[ -n $MASTER ]] +then + [[ -f $TOP/etc/minion.example ]] || mv $TOP/etc/minion{,.example} + echo "master: $MASTER" > $TOP/etc/minion + echo "Minion configured to talk to master $MASTER. Enabling minion now." + svcadm enable salt-minion +else + echo "To enable minion service, invoke:" + echo " svcadm enable salt-minion" +fi + +rm -rf $OUTPUT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/pkg/smartos/esky/requirements.txt new/salt-2014.1.8/pkg/smartos/esky/requirements.txt --- old/salt-2014.1.7/pkg/smartos/esky/requirements.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/salt-2014.1.8/pkg/smartos/esky/requirements.txt 2014-07-30 21:48:57.000000000 +0200 @@ -0,0 +1,3 @@ +GitPython==0.3.2.RC1 +halite +cherrypy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/pkg/smartos/esky/salt-minion.xml new/salt-2014.1.8/pkg/smartos/esky/salt-minion.xml --- old/salt-2014.1.7/pkg/smartos/esky/salt-minion.xml 2014-06-24 22:07:36.000000000 +0200 +++ new/salt-2014.1.8/pkg/smartos/esky/salt-minion.xml 2014-07-29 18:03:05.000000000 +0200 @@ -28,7 +28,7 @@ <exec_method type="method" name="start" - exec="SALT_PREFIX/bin/salt-minion" + exec="auditconfig -setaudit 0 lo 0,0,localhost 5417 SALT_PREFIX/bin/salt-minion" timeout_seconds="60"> <method_context> <method_environment> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/salt/client/ssh/__init__.py new/salt-2014.1.8/salt/client/ssh/__init__.py --- old/salt-2014.1.7/salt/client/ssh/__init__.py 2014-06-24 23:41:29.000000000 +0200 +++ new/salt-2014.1.8/salt/client/ssh/__init__.py 2014-07-30 21:49:32.000000000 +0200 @@ -137,6 +137,16 @@ if [ $? -ne 0 ]; then exit 1 fi + if [ "$(stat -c %a /tmp/.salt)" != "700" ] + then + echo "Permissions for /tmp/.salt not correct. Exiting!" + exit 1 + fi + if [ "$(stat -c %u /tmp/.salt)" != "0" ] + then + echo "Ownership for /tmp/.salt not correct. Exiting!" + exit 1 + fi echo "{1}" echo "deploy" exit 1 @@ -158,7 +168,7 @@ exit 1 fi else - mkdir -m 0700 -p /tmp/.salt + rm -rf /tmp/.salt && mkdir -m 0700 -p /tmp/.salt echo "{1}" echo "deploy" exit 1 @@ -284,6 +294,7 @@ ''' The ssh-copy-id routine ''' + ret = {} arg_str = 'ssh.set_auth_key {0} {1}'.format( target.get('user', 'root'), self.get_pubkey()) @@ -806,8 +817,8 @@ trans_tar = prep_trans_tar(self.opts, chunks, file_refs) self.shell.send( trans_tar, - '/tmp/salt_state.tgz') - self.arg_str = 'state.pkg /tmp/salt_state.tgz test={0}'.format(test) + '/tmp/.salt/salt_state.tgz') + self.arg_str = 'state.pkg /tmp/.salt/salt_state.tgz test={0}'.format(test) class SSHState(salt.state.State): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/salt/cloud/libcloudfuncs.py new/salt-2014.1.8/salt/cloud/libcloudfuncs.py --- old/salt-2014.1.7/salt/cloud/libcloudfuncs.py 2014-06-24 22:07:36.000000000 +0200 +++ new/salt-2014.1.8/salt/cloud/libcloudfuncs.py 2014-07-30 21:48:57.000000000 +0200 @@ -43,7 +43,7 @@ return states[id_] -def check_libcloud_version(reqver='0.13.2', why=None): +def check_libcloud_version(reqver=(0, 13, 2), why=None): ''' Compare different libcloud versions ''' @@ -52,11 +52,7 @@ except ImportError: raise ImportError('salt-cloud requires >= libcloud {0}'.format(reqver)) - reqver = reqver.replace('-', '.') - comps = reqver.split('.') - required_version = [] - for number in comps[:3]: - required_version.append(int(number)) + required_version = list(reqver) ver = libcloud.__version__ ver = ver.replace('-', '.') comps = ver.split('.') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/salt/modules/config.py new/salt-2014.1.8/salt/modules/config.py --- old/salt-2014.1.7/salt/modules/config.py 2014-06-24 22:07:36.000000000 +0200 +++ new/salt-2014.1.8/salt/modules/config.py 2014-07-30 21:49:32.000000000 +0200 @@ -250,22 +250,3 @@ if key.startswith('{0}.'.format(value)): ret[key] = val return ret - - -def gather_bootstrap_script(replace=False): - ''' - Download the salt-bootstrap script, set replace to True to refresh the - script if it has already been downloaded - - CLI Example: - - .. code-block:: bash - - salt '*' config.gather_bootstrap_script True - ''' - fn_ = os.path.join(__opts__['cachedir'], 'bootstrap.sh') - if not replace and os.path.isfile(fn_): - return fn_ - with salt.utils.fopen(fn_, 'w+') as fp_: - fp_.write(urllib2.urlopen('http://bootstrap.saltstack.org').read()) - return fn_ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/salt/modules/seed.py new/salt-2014.1.8/salt/modules/seed.py --- old/salt-2014.1.7/salt/modules/seed.py 2014-06-24 23:41:29.000000000 +0200 +++ new/salt-2014.1.8/salt/modules/seed.py 2014-07-30 21:49:32.000000000 +0200 @@ -15,6 +15,7 @@ import salt.crypt import salt.utils import salt.config +import salt.syspaths # Set up logging @@ -149,17 +150,11 @@ install it. Return True if install is successful or already installed. ''' - # Verify that the boostrap script is downloaded - bs_ = __salt__['config.gather_bootstrap_script']() - log.warn('bootstrap: {0}'.format(bs_)) - # Apply the minion config - # Copy script into tmp - shutil.copy(bs_, os.path.join(mpt, 'tmp')) _check_resolv(mpt) # Exec the chroot command cmd = 'if type salt-minion; then exit 0; ' - cmd += 'else sh /tmp/bootstrap.sh -c /tmp; fi' + cmd += 'else sh {0} -c /tmp; fi'.format(salt.syspaths.BOOTSTRAP) return not _chroot_exec(mpt, cmd) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/salt/modules/smf.py new/salt-2014.1.8/salt/modules/smf.py --- old/salt-2014.1.7/salt/modules/smf.py 2014-06-24 23:41:29.000000000 +0200 +++ new/salt-2014.1.8/salt/modules/smf.py 2014-07-30 21:48:24.000000000 +0200 @@ -51,7 +51,7 @@ salt '*' service.get_running ''' ret = set() - cmd = '/usr/bin/svcs -H -o SVC,STATE -s SVC' + cmd = '/usr/bin/svcs -H -o FMRI,STATE -s FMRI' lines = __salt__['cmd.run'](cmd).splitlines() for line in lines: comps = line.split() @@ -73,7 +73,7 @@ salt '*' service.get_stopped ''' ret = set() - cmd = '/usr/bin/svcs -aH -o SVC,STATE -s SVC' + cmd = '/usr/bin/svcs -aH -o FMRI,STATE -s FMRI' lines = __salt__['cmd.run'](cmd).splitlines() for line in lines: comps = line.split() @@ -89,12 +89,17 @@ Returns ``True`` if the specified service is available, otherwise returns ``False``. + We look up the name with the svcs command to get back the FMRI + This allows users to use simpler service names + CLI Example: .. code-block:: bash salt '*' service.available net-snmp ''' + cmd = '/usr/bin/svcs -H -o FMRI {0}'.format(name) + name = __salt__['cmd.run'](cmd) return name in get_all() @@ -110,6 +115,8 @@ salt '*' service.missing net-snmp ''' + cmd = '/usr/bin/svcs -H -o FMRI {0}'.format(name) + name = __salt__['cmd.run'](cmd) return name not in get_all() @@ -124,7 +131,7 @@ salt '*' service.get_all ''' ret = set() - cmd = '/usr/bin/svcs -aH -o SVC,STATE -s SVC' + cmd = '/usr/bin/svcs -aH -o FMRI,STATE -s FMRI' lines = __salt__['cmd.run'](cmd).splitlines() for line in lines: comps = line.split() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/salt/pillar/git_pillar.py new/salt-2014.1.8/salt/pillar/git_pillar.py --- old/salt-2014.1.7/salt/pillar/git_pillar.py 2014-06-24 23:41:29.000000000 +0200 +++ new/salt-2014.1.8/salt/pillar/git_pillar.py 2014-07-30 21:48:57.000000000 +0200 @@ -99,26 +99,27 @@ for idx, opts_dict in enumerate(self.opts['ext_pillar']): - # self.opts['ext_pillar'] always contains full ext_pillar list - if 'git' not in opts_dict: - continue - + # self.opts['ext_pillar'] always contains the full list of + # ext_pillar options specified in the master config file. + # We iterate over that list until we find the branch and location + # that match the options passed in via the 'opts' variable. + # The reason this is done in a loop is to set the 'idx' variable, + # which is used to form the path to the cached local copy of the + # git repository. parts = opts_dict.get('git', '').split() - # parts = 2: 'master' 'git_repo_uri' - # parts = 3: 'master' 'git_repo_uri' 'root=pillars_dir' - if len(parts) == 2: - self.branch = parts[0] - self.rp_location = parts[1] - elif len(parts) == 3: - self.branch = parts[0] - self.rp_location = parts[1] - self.root = parts[2] - else: - log.error("Unable to initilize GitPillar with ext_pillar: %s", + # expected option format: + # len(parts) = 2: 'master' 'git_repo_uri' + # len(parts) = 3: 'master' 'git_repo_uri' 'root=pillars_dir' + if len(parts) < 2 or len(parts) > 3: + log.error("Unable to initilize GitPillar with invalid \ + ext_pillar option format: %s", opts_dict.get('git', None)) break + if self.branch != parts[0] or self.rp_location != parts[1]: + continue + rp_ = os.path.join(self.opts['cachedir'], 'pillar_gitfs', str(idx)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/salt/syspaths.py new/salt-2014.1.8/salt/syspaths.py --- old/salt-2014.1.7/salt/syspaths.py 2014-06-24 22:07:36.000000000 +0200 +++ new/salt-2014.1.8/salt/syspaths.py 2014-07-30 21:49:32.000000000 +0200 @@ -58,3 +58,6 @@ BASE_MASTER_ROOTS_DIR = os.path.join(SRV_ROOT_DIR, 'salt-master') LOGS_DIR = os.path.join(ROOT_DIR, 'var', 'log', 'salt') PIDFILE_DIR = os.path.join(ROOT_DIR, 'var', 'run') + INSTALL_DIR = os.path.dirname(os.path.realpath(__file__)) + CLOUD_DIR = os.path.join(INSTALL_DIR, 'cloud') + BOOTSTRAP = os.path.join(CLOUD_DIR, 'deploy', 'bootstrap-salt.sh') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/salt/utils/cloud.py new/salt-2014.1.8/salt/utils/cloud.py --- old/salt-2014.1.7/salt/utils/cloud.py 2014-06-27 22:26:23.000000000 +0200 +++ new/salt-2014.1.8/salt/utils/cloud.py 2014-07-30 21:49:32.000000000 +0200 @@ -16,6 +16,7 @@ import logging import pipes import re +import uuid # Let's import pwd and catch the ImportError. We'll raise it if this is not # Windows @@ -553,6 +554,8 @@ ''' Copy a deploy script to a remote server, execute it, and remove it ''' + tmp_dir = '{0}-{1}'.format(tmp_dir, uuid.uuid4()) + deploy_command = os.path.join(tmp_dir, 'deploy.sh') if key_filename is not None and not os.path.isfile(key_filename): raise SaltCloudConfigError( 'The defined key_filename {0!r} does not exist'.format( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/salt/utils/filebuffer.py new/salt-2014.1.8/salt/utils/filebuffer.py --- old/salt-2014.1.7/salt/utils/filebuffer.py 2014-06-24 22:07:36.000000000 +0200 +++ new/salt-2014.1.8/salt/utils/filebuffer.py 2014-07-30 21:49:32.000000000 +0200 @@ -99,62 +99,3 @@ def __exit__(self, exc_type, exc_value, traceback): pass - - -def _main(): - def timeit_string(fpath, max_size, chunk_size): - - breader = BufferedReader(fpath, max_size, chunk_size) - for chunk in breader: - chunk # pylint: disable=W0104 - return - - def sizeof_fmt(num): - for unit in ['bytes', 'KB', 'MB', 'GB']: - if num < 1024.0: - return '{0:3.1f}{1}'.format(num, unit) - num /= 1024.0 - return '{0:3.1f}{1}'.format(num, 'TB') - - import os - import timeit - fpath = os.path.normpath(os.path.join( - os.path.dirname(__file__), - "../../doc/topics/tutorials/starting_states.rst" - )) - - tpath = "/tmp/starting_states.rst" - - for fmultiplier in (1, 10, 50, 100, 800, 3200): - ffile = salt.utils.fopen(tpath, 'w') - while fmultiplier > 0: - ffile.write(salt.utils.fopen(fpath).read()) - fmultiplier -= 1 - - ffile.close() - - tnumber = 1000 - - print('Running tests against a file with the size of {0}'.format( - sizeof_fmt(os.stat(tpath).st_size)) - ) - - for multiplier in [4, 8, 16, 32, 64, 128, 256]: - chunk_size = multiplier * 1024 - max_size = chunk_size * 5 - timer = timeit.Timer( - "timeit_string('{0}', {1:d}, {2:d})".format( - tpath, max_size, chunk_size - ), "from __main__ import timeit_string" - ) - print("timeit_string ({0: >7} chunks; max: {1: >7}):".format( - sizeof_fmt(chunk_size), sizeof_fmt(max_size))), - print(u"{0: >6} \u00B5sec/pass".format(u"{0:0.2f}".format( - tnumber * timer.timeit(number=tnumber) / tnumber - ))) - - print - - -if __name__ == '__main__': - _main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/salt/version.py new/salt-2014.1.8/salt/version.py --- old/salt-2014.1.7/salt/version.py 2014-07-09 22:57:34.000000000 +0200 +++ new/salt-2014.1.8/salt/version.py 2014-07-30 21:48:57.000000000 +0200 @@ -19,7 +19,22 @@ # ----- ATTENTION ---------------------------------------------------------------------------------------------------> # -# For version bumps, please update `__saltstack_version__` below +# ALL major version bumps, new release codenames, MUST be defined in the SaltStackVersion.NAMES dictionary, ie: +# +# class SaltStackVersion(object): +# +# NAMES = { +# 'Hydrogen': (2014, 1), # <- This is the tuple to bump versions +# ( ... ) +# } +# +# +# ONLY UPDATE CODENAMES AFTER BRANCHING +# +# As an example, The Helium codename must only be properly defined with "(2014, 7)" after Hydrogen, "(2014, 1)", has +# been branched out into it's own branch. +# +# ALL OTHER VERSION INFORMATION IS EXTRACTED FROM THE GIT TAGS # # <---- ATTENTION ---------------------------------------------------------------------------------------------------- @@ -32,13 +47,17 @@ and also supports version comparison. ''' - __slots__ = ('name', 'major', 'minor', 'bugfix', 'rc', 'noc', 'sha') + __slots__ = ('name', 'major', 'minor', 'bugfix', 'mbugfix', 'rc', 'noc', 'sha') git_describe_regex = re.compile( - r'(?:[^\d]+)?(?P<major>[\d]{1,4})\.(?P<minor>[\d]{1,2})' - r'(?:\.(?P<bugfix>[\d]{0,2}))?(?:rc(?P<rc>[\d]{1}))?' - r'(?:(?:.*)-(?P<noc>[\d]+)-(?P<sha>[a-z0-9]{8}))?' + r'(?:[^\d]+)?(?P<major>[\d]{1,4})' + r'\.(?P<minor>[\d]{1,2})' + r'(?:\.(?P<bugfix>[\d]{0,2}))?' + r'(?:\.(?P<mbugfix>[\d]{0,2}))?' + r'(?:rc(?P<rc>[\d]{1}))?' + r'(?:(?:.*)-(?P<noc>(?:[\d]+|n/a))-(?P<sha>[a-z0-9]{8}))?' ) + git_sha_regex = re.compile(r'(?P<sha>[a-z0-9]{7})') # Salt versions after 0.17.0 will be numbered like: # <4-digit-year>.<month>.<bugfix> @@ -52,119 +71,121 @@ # latest release so we can map deprecation warnings to versions. - # ----- Please refrain from fixing PEP-8 E203 ---------------------------------------------------------------> + # pylint: disable=E8203,E8265 + # ----- Please refrain from fixing PEP-8 E203 and E265 ------------------------------------------------------> # The idea is keep this readable # ------------------------------------------------------------------------------------------------------------ - 'Hydrogen': (2014, 1, 7, 0), - 'Helium': (sys.maxint - 107, 0, 0, 0), - 'Lithium': (sys.maxint - 106, 0, 0, 0), - 'Beryllium': (sys.maxint - 105, 0, 0, 0), - 'Boron': (sys.maxint - 104, 0, 0, 0), - #'Carbon' : (sys.maxint - 103, 0, 0, 0), - #'Nitrogen' : (sys.maxint - 102, 0, 0, 0), - #'Oxygen' : (sys.maxint - 101, 0, 0, 0), - #'Fluorine' : (sys.maxint - 100, 0, 0, 0), - #'Neon' : (sys.maxint - 99 , 0, 0, 0), - #'Sodium' : (sys.maxint - 98 , 0, 0, 0), - #'Magnesium' : (sys.maxint - 97 , 0, 0, 0), - #'Aluminium' : (sys.maxint - 96 , 0, 0, 0), - #'Silicon' : (sys.maxint - 95 , 0, 0, 0), - #'Phosphorus' : (sys.maxint - 94 , 0, 0, 0), - #'Sulfur' : (sys.maxint - 93 , 0, 0, 0), - #'Chlorine' : (sys.maxint - 92 , 0, 0, 0), - #'Argon' : (sys.maxint - 91 , 0, 0, 0), - #'Potassium' : (sys.maxint - 90 , 0, 0, 0), - #'Calcium' : (sys.maxint - 89 , 0, 0, 0), - #'Scandium' : (sys.maxint - 88 , 0, 0, 0), - #'Titanium' : (sys.maxint - 87 , 0, 0, 0), - #'Vanadium' : (sys.maxint - 86 , 0, 0, 0), - #'Chromium' : (sys.maxint - 85 , 0, 0, 0), - #'Manganese' : (sys.maxint - 84 , 0, 0, 0), - #'Iron' : (sys.maxint - 83 , 0, 0, 0), - #'Cobalt' : (sys.maxint - 82 , 0, 0, 0), - #'Nickel' : (sys.maxint - 81 , 0, 0, 0), - #'Copper' : (sys.maxint - 80 , 0, 0, 0), - #'Zinc' : (sys.maxint - 79 , 0, 0, 0), - #'Gallium' : (sys.maxint - 78 , 0, 0, 0), - #'Germanium' : (sys.maxint - 77 , 0, 0, 0), - #'Arsenic' : (sys.maxint - 76 , 0, 0, 0), - #'Selenium' : (sys.maxint - 75 , 0, 0, 0), - #'Bromine' : (sys.maxint - 74 , 0, 0, 0), - #'Krypton' : (sys.maxint - 73 , 0, 0, 0), - #'Rubidium' : (sys.maxint - 72 , 0, 0, 0), - #'Strontium' : (sys.maxint - 71 , 0, 0, 0), - #'Yttrium' : (sys.maxint - 70 , 0, 0, 0), - #'Zirconium' : (sys.maxint - 69 , 0, 0, 0), - #'Niobium' : (sys.maxint - 68 , 0, 0, 0), - #'Molybdenum' : (sys.maxint - 67 , 0, 0, 0), - #'Technetium' : (sys.maxint - 66 , 0, 0, 0), - #'Ruthenium' : (sys.maxint - 65 , 0, 0, 0), - #'Rhodium' : (sys.maxint - 64 , 0, 0, 0), - #'Palladium' : (sys.maxint - 63 , 0, 0, 0), - #'Silver' : (sys.maxint - 62 , 0, 0, 0), - #'Cadmium' : (sys.maxint - 61 , 0, 0, 0), - #'Indium' : (sys.maxint - 60 , 0, 0, 0), - #'Tin' : (sys.maxint - 59 , 0, 0, 0), - #'Antimony' : (sys.maxint - 58 , 0, 0, 0), - #'Tellurium' : (sys.maxint - 57 , 0, 0, 0), - #'Iodine' : (sys.maxint - 56 , 0, 0, 0), - #'Xenon' : (sys.maxint - 55 , 0, 0, 0), - #'Caesium' : (sys.maxint - 54 , 0, 0, 0), - #'Barium' : (sys.maxint - 53 , 0, 0, 0), - #'Lanthanum' : (sys.maxint - 52 , 0, 0, 0), - #'Cerium' : (sys.maxint - 51 , 0, 0, 0), - #'Praseodymium' : (sys.maxint - 50 , 0, 0, 0), - #'Neodymium' : (sys.maxint - 49 , 0, 0, 0), - #'Promethium' : (sys.maxint - 48 , 0, 0, 0), - #'Samarium' : (sys.maxint - 47 , 0, 0, 0), - #'Europium' : (sys.maxint - 46 , 0, 0, 0), - #'Gadolinium' : (sys.maxint - 45 , 0, 0, 0), - #'Terbium' : (sys.maxint - 44 , 0, 0, 0), - #'Dysprosium' : (sys.maxint - 43 , 0, 0, 0), - #'Holmium' : (sys.maxint - 42 , 0, 0, 0), - #'Erbium' : (sys.maxint - 41 , 0, 0, 0), - #'Thulium' : (sys.maxint - 40 , 0, 0, 0), - #'Ytterbium' : (sys.maxint - 39 , 0, 0, 0), - #'Lutetium' : (sys.maxint - 38 , 0, 0, 0), - #'Hafnium' : (sys.maxint - 37 , 0, 0, 0), - #'Tantalum' : (sys.maxint - 36 , 0, 0, 0), - #'Tungsten' : (sys.maxint - 35 , 0, 0, 0), - #'Rhenium' : (sys.maxint - 34 , 0, 0, 0), - #'Osmium' : (sys.maxint - 33 , 0, 0, 0), - #'Iridium' : (sys.maxint - 32 , 0, 0, 0), - #'Platinum' : (sys.maxint - 31 , 0, 0, 0), - #'Gold' : (sys.maxint - 30 , 0, 0, 0), - #'Mercury' : (sys.maxint - 29 , 0, 0, 0), - #'Thallium' : (sys.maxint - 28 , 0, 0, 0), - #'Lead' : (sys.maxint - 27 , 0, 0, 0), - #'Bismuth' : (sys.maxint - 26 , 0, 0, 0), - #'Polonium' : (sys.maxint - 25 , 0, 0, 0), - #'Astatine' : (sys.maxint - 24 , 0, 0, 0), - #'Radon' : (sys.maxint - 23 , 0, 0, 0), - #'Francium' : (sys.maxint - 22 , 0, 0, 0), - #'Radium' : (sys.maxint - 21 , 0, 0, 0), - #'Actinium' : (sys.maxint - 20 , 0, 0, 0), - #'Thorium' : (sys.maxint - 19 , 0, 0, 0), - #'Protactinium' : (sys.maxint - 18 , 0, 0, 0), - #'Uranium' : (sys.maxint - 17 , 0, 0, 0), - #'Neptunium' : (sys.maxint - 16 , 0, 0, 0), - #'Plutonium' : (sys.maxint - 15 , 0, 0, 0), - #'Americium' : (sys.maxint - 14 , 0, 0, 0), - #'Curium' : (sys.maxint - 13 , 0, 0, 0), - #'Berkelium' : (sys.maxint - 12 , 0, 0, 0), - #'Californium' : (sys.maxint - 11 , 0, 0, 0), - #'Einsteinium' : (sys.maxint - 10 , 0, 0, 0), - #'Fermium' : (sys.maxint - 9 , 0, 0, 0), - #'Mendelevium' : (sys.maxint - 8 , 0, 0, 0), - #'Nobelium' : (sys.maxint - 7 , 0, 0, 0), - #'Lawrencium' : (sys.maxint - 6 , 0, 0, 0), - #'Rutherfordium': (sys.maxint - 5 , 0, 0, 0), - #'Dubnium' : (sys.maxint - 4 , 0, 0, 0), - #'Seaborgium' : (sys.maxint - 3 , 0, 0, 0), - #'Bohrium' : (sys.maxint - 2 , 0, 0, 0), - #'Hassium' : (sys.maxint - 1 , 0, 0, 0), - #'Meitnerium' : (sys.maxint - 0 , 0, 0, 0), - # <---- Please refrain from fixing PEP-8 E203 ---------------------------------------------------------------- + 'Hydrogen' : (2014, 1), + 'Helium' : (sys.maxint - 107, 0), + 'Lithium' : (sys.maxint - 106, 0), + 'Beryllium' : (sys.maxint - 105, 0), + 'Boron' : (sys.maxint - 104, 0), + #'Carbon' : (sys.maxint - 103, 0), + #'Nitrogen' : (sys.maxint - 102, 0), + #'Oxygen' : (sys.maxint - 101, 0), + #'Fluorine' : (sys.maxint - 100, 0), + #'Neon' : (sys.maxint - 99 , 0), + #'Sodium' : (sys.maxint - 98 , 0), + #'Magnesium' : (sys.maxint - 97 , 0), + #'Aluminium' : (sys.maxint - 96 , 0), + #'Silicon' : (sys.maxint - 95 , 0), + #'Phosphorus' : (sys.maxint - 94 , 0), + #'Sulfur' : (sys.maxint - 93 , 0), + #'Chlorine' : (sys.maxint - 92 , 0), + #'Argon' : (sys.maxint - 91 , 0), + #'Potassium' : (sys.maxint - 90 , 0), + #'Calcium' : (sys.maxint - 89 , 0), + #'Scandium' : (sys.maxint - 88 , 0), + #'Titanium' : (sys.maxint - 87 , 0), + #'Vanadium' : (sys.maxint - 86 , 0), + #'Chromium' : (sys.maxint - 85 , 0), + #'Manganese' : (sys.maxint - 84 , 0), + #'Iron' : (sys.maxint - 83 , 0), + #'Cobalt' : (sys.maxint - 82 , 0), + #'Nickel' : (sys.maxint - 81 , 0), + #'Copper' : (sys.maxint - 80 , 0), + #'Zinc' : (sys.maxint - 79 , 0), + #'Gallium' : (sys.maxint - 78 , 0), + #'Germanium' : (sys.maxint - 77 , 0), + #'Arsenic' : (sys.maxint - 76 , 0), + #'Selenium' : (sys.maxint - 75 , 0), + #'Bromine' : (sys.maxint - 74 , 0), + #'Krypton' : (sys.maxint - 73 , 0), + #'Rubidium' : (sys.maxint - 72 , 0), + #'Strontium' : (sys.maxint - 71 , 0), + #'Yttrium' : (sys.maxint - 70 , 0), + #'Zirconium' : (sys.maxint - 69 , 0), + #'Niobium' : (sys.maxint - 68 , 0), + #'Molybdenum' : (sys.maxint - 67 , 0), + #'Technetium' : (sys.maxint - 66 , 0), + #'Ruthenium' : (sys.maxint - 65 , 0), + #'Rhodium' : (sys.maxint - 64 , 0), + #'Palladium' : (sys.maxint - 63 , 0), + #'Silver' : (sys.maxint - 62 , 0), + #'Cadmium' : (sys.maxint - 61 , 0), + #'Indium' : (sys.maxint - 60 , 0), + #'Tin' : (sys.maxint - 59 , 0), + #'Antimony' : (sys.maxint - 58 , 0), + #'Tellurium' : (sys.maxint - 57 , 0), + #'Iodine' : (sys.maxint - 56 , 0), + #'Xenon' : (sys.maxint - 55 , 0), + #'Caesium' : (sys.maxint - 54 , 0), + #'Barium' : (sys.maxint - 53 , 0), + #'Lanthanum' : (sys.maxint - 52 , 0), + #'Cerium' : (sys.maxint - 51 , 0), + #'Praseodymium' : (sys.maxint - 50 , 0), + #'Neodymium' : (sys.maxint - 49 , 0), + #'Promethium' : (sys.maxint - 48 , 0), + #'Samarium' : (sys.maxint - 47 , 0), + #'Europium' : (sys.maxint - 46 , 0), + #'Gadolinium' : (sys.maxint - 45 , 0), + #'Terbium' : (sys.maxint - 44 , 0), + #'Dysprosium' : (sys.maxint - 43 , 0), + #'Holmium' : (sys.maxint - 42 , 0), + #'Erbium' : (sys.maxint - 41 , 0), + #'Thulium' : (sys.maxint - 40 , 0), + #'Ytterbium' : (sys.maxint - 39 , 0), + #'Lutetium' : (sys.maxint - 38 , 0), + #'Hafnium' : (sys.maxint - 37 , 0), + #'Tantalum' : (sys.maxint - 36 , 0), + #'Tungsten' : (sys.maxint - 35 , 0), + #'Rhenium' : (sys.maxint - 34 , 0), + #'Osmium' : (sys.maxint - 33 , 0), + #'Iridium' : (sys.maxint - 32 , 0), + #'Platinum' : (sys.maxint - 31 , 0), + #'Gold' : (sys.maxint - 30 , 0), + #'Mercury' : (sys.maxint - 29 , 0), + #'Thallium' : (sys.maxint - 28 , 0), + #'Lead' : (sys.maxint - 27 , 0), + #'Bismuth' : (sys.maxint - 26 , 0), + #'Polonium' : (sys.maxint - 25 , 0), + #'Astatine' : (sys.maxint - 24 , 0), + #'Radon' : (sys.maxint - 23 , 0), + #'Francium' : (sys.maxint - 22 , 0), + #'Radium' : (sys.maxint - 21 , 0), + #'Actinium' : (sys.maxint - 20 , 0), + #'Thorium' : (sys.maxint - 19 , 0), + #'Protactinium' : (sys.maxint - 18 , 0), + #'Uranium' : (sys.maxint - 17 , 0), + #'Neptunium' : (sys.maxint - 16 , 0), + #'Plutonium' : (sys.maxint - 15 , 0), + #'Americium' : (sys.maxint - 14 , 0), + #'Curium' : (sys.maxint - 13 , 0), + #'Berkelium' : (sys.maxint - 12 , 0), + #'Californium' : (sys.maxint - 11 , 0), + #'Einsteinium' : (sys.maxint - 10 , 0), + #'Fermium' : (sys.maxint - 9 , 0), + #'Mendelevium' : (sys.maxint - 8 , 0), + #'Nobelium' : (sys.maxint - 7 , 0), + #'Lawrencium' : (sys.maxint - 6 , 0), + #'Rutherfordium': (sys.maxint - 5 , 0), + #'Dubnium' : (sys.maxint - 4 , 0), + #'Seaborgium' : (sys.maxint - 3 , 0), + #'Bohrium' : (sys.maxint - 2 , 0), + #'Hassium' : (sys.maxint - 1 , 0), + #'Meitnerium' : (sys.maxint - 0 , 0), + # <---- Please refrain from fixing PEP-8 E203 and E265 ------------------------------------------------------- + # pylint: enable=E8203,E8265 } LNAMES = dict((k.lower(), v) for (k, v) in NAMES.iteritems()) @@ -175,6 +196,7 @@ major, minor, bugfix=0, + mbugfix=0, rc=0, # pylint: disable=C0103 noc=0, sha=None): @@ -190,6 +212,11 @@ elif isinstance(bugfix, string_types): bugfix = int(bugfix) + if mbugfix is None: + mbugfix = 0 + elif isinstance(mbugfix, string_types): + mbugfix = int(mbugfix) + if rc is None: rc = 0 elif isinstance(rc, string_types): @@ -197,14 +224,17 @@ if noc is None: noc = 0 + elif isinstance(noc, string_types) and noc == 'n/a': + noc = -1 elif isinstance(noc, string_types): noc = int(noc) self.major = major self.minor = minor self.bugfix = bugfix + self.mbugfix = mbugfix self.rc = rc # pylint: disable=C0103 - self.name = self.VNAMES.get((major, minor, bugfix, rc), None) + self.name = self.VNAMES.get((major, minor), None) self.noc = noc self.sha = sha @@ -227,12 +257,28 @@ ) return cls(*cls.LNAMES[name.lower()]) + @classmethod + def from_last_named_version(cls): + return cls.from_name( + cls.VNAMES[ + max([version_info for version_info in + cls.VNAMES.keys() if + version_info[0] < (sys.maxint - 200)]) + ] + ) + + @property + def sse(self): + # Higher than 0.17, lower than first date based + return 0 < self.major < 2014 + @property def info(self): return ( self.major, self.minor, - self.bugfix + self.bugfix, + self.mbugfix ) @property @@ -241,6 +287,7 @@ self.major, self.minor, self.bugfix, + self.mbugfix, self.rc ) @@ -250,6 +297,7 @@ self.major, self.minor, self.bugfix, + self.mbugfix, self.rc, self.noc ) @@ -260,6 +308,7 @@ self.major, self.minor, self.bugfix, + self.mbugfix, self.rc, self.noc, self.sha @@ -272,19 +321,31 @@ self.minor, self.bugfix ) + if self.mbugfix: + version_string += '.{0}'.format(self.mbugfix) if self.rc: version_string += 'rc{0}'.format(self.rc) if self.noc and self.sha: - version_string += '-{0}-{1}'.format(self.noc, self.sha) - #if (self.major, self.minor) in self.RMATCH: - # version_string += ' ({0})'.format(self.RMATCH[(self.major, self.minor)]) + noc = self.noc + if noc < 0: + noc = 'n/a' + version_string += '-{0}-{1}'.format(noc, self.sha) return version_string @property def formatted_version(self): if self.name and self.major > 10000: - return '{0} (Unreleased)'.format(self.name) - return self.string + version_string = self.name + if self.sse: + version_string += ' Enterprise' + version_string += ' (Unreleased)' + return version_string + version_string = self.string + if self.sse: + version_string += ' Enterprise' + if (self.major, self.minor) in self.RMATCH: + version_string += ' ({0})'.format(self.RMATCH[(self.major, self.minor)]) + return version_string def __str__(self): return self.string @@ -326,47 +387,45 @@ 'minor={0}'.format(self.minor), 'bugfix={0}'.format(self.bugfix) ]) + if self.mbugfix: + parts.append('minor-bugfix={0}'.format(self.mbugfix)) if self.rc: parts.append('rc={0}'.format(self.rc)) + noc = self.noc + if noc == -1: + noc = 'n/a' + if noc and self.sha: + parts.extend([ + 'noc={0}'.format(noc), + 'sha={0}'.format(self.sha) + ]) return '<{0} {1}>'.format(self.__class__.__name__, ' '.join(parts)) -# ----- Hardcoded Salt Version Information --------------------------------------------------------------------------> -# -# ALL version bumps should be done in the SaltStackVersion.NAMES dictionary, ie: -# -# class SaltStackVersion(object): -# -# NAMES = { -# 'Hydrogen': (2014, 1, 0, 0), # <- This is the tuple to bump versions -# ( ... ) -# } +# ----- Hardcoded Salt Codename Version Information -----------------------------------------------------------------> # +# There's no need to do anything here. The last released codename will be picked up # -------------------------------------------------------------------------------------------------------------------- -# There's no need to edit any of the version dunder objects below, see above why and where to update -__saltstack_version__ = SaltStackVersion.from_name('Hydrogen') -__version_info__ = __saltstack_version__.info -__version__ = __saltstack_version__.string +__saltstack_version__ = SaltStackVersion.from_last_named_version() # <---- Hardcoded Salt Version Information --------------------------------------------------------------------------- # ----- Dynamic/Runtime Salt Version Information --------------------------------------------------------------------> -def __get_version(version, version_info): +def __get_version(saltstack_version): ''' If we can get a version provided at installation time or from Git, use that instead, otherwise we carry on. ''' try: # Try to import the version information provided at install time - from salt._version import __version__, __version_info__ # pylint: disable=E0611,F0401 - return __version__, __version_info__ + from salt._version import __saltstack_version__ # pylint: disable=E0611,F0401 + return __saltstack_version__ except ImportError: pass # This might be a 'python setup.py develop' installation type. Let's # discover the version information at runtime. import os - import warnings import subprocess if 'SETUP_DIRNAME' in globals(): @@ -374,12 +433,12 @@ cwd = SETUP_DIRNAME # pylint: disable=E0602 if not os.path.exists(os.path.join(cwd, '.git')): # This is not a Salt git checkout!!! Don't even try to parse... - return version, version_info + return saltstack_version else: cwd = os.path.abspath(os.path.dirname(__file__)) if not os.path.exists(os.path.join(os.path.dirname(cwd), '.git')): # This is not a Salt git checkout!!! Don't even try to parse... - return version, version_info + return saltstack_version try: kwargs = dict( @@ -393,60 +452,46 @@ kwargs['close_fds'] = True process = subprocess.Popen( - ['git', 'describe', '--tags', '--match', 'v[0-9]*'], **kwargs) + ['git', 'describe', '--tags', '--match', 'v[0-9]*', '--always'], **kwargs) out, err = process.communicate() out = out.strip() err = err.strip() if not out or err: - return version, version_info + return saltstack_version - parsed_version = SaltStackVersion.parse(out) + try: + return SaltStackVersion.parse(out) + except ValueError: + if not SaltStackVersion.git_sha_regex.match(out): + raise + + # We only define the parsed SHA and set NOC as ??? (unknown) + saltstack_version.sha = out.strip() + saltstack_version.noc = -1 - if parsed_version.info > version_info: - warnings.warn( - 'The parsed version info, `{0}`, is bigger than the one ' - 'defined in the file, `{1}`. Missing version bump?'.format( - parsed_version.info, - version_info - ), - UserWarning, - stacklevel=2 - ) - return version, version_info - elif parsed_version.info < version_info: - warnings.warn( - 'The parsed version info, `{0}`, is lower than the one ' - 'defined in the file, `{1}`.' - 'In order to get the proper salt version with the git hash ' - 'you need to update salt\'s local git tags. Something like: ' - '\'git fetch --tags\' or \'git fetch --tags upstream\' if ' - 'you followed salt\'s contribute documentation. The version ' - 'string WILL NOT include the git hash.'.format( - parsed_version.info, - version_info - ), - UserWarning, - stacklevel=2 - ) - return version, version_info - return parsed_version.string, parsed_version.info except OSError as os_err: if os_err.errno != 2: # If the errno is not 2(The system cannot find the file # specified), raise the exception so it can be catch by the # developers raise - return version, version_info + return saltstack_version # Get additional version information if available -__version__, __version_info__ = __get_version(__version__, __version_info__) +__saltstack_version__ = __get_version(__saltstack_version__) # This function has executed once, we're done with it. Delete it! del __get_version # <---- Dynamic/Runtime Salt Version Information --------------------------------------------------------------------- +# ----- Common version related attributes - NO NEED TO CHANGE -------------------------------------------------------> +__version_info__ = __saltstack_version__.info +__version__ = __saltstack_version__.string +# <---- Common version related attributes - NO NEED TO CHANGE -------------------------------------------------------- + + def versions_information(include_salt_cloud=False): ''' Report on all of the versions for dependent software diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-2014.1.7/tests/unit/version_test.py new/salt-2014.1.8/tests/unit/version_test.py --- old/salt-2014.1.7/tests/unit/version_test.py 2014-06-24 22:07:36.000000000 +0200 +++ new/salt-2014.1.8/tests/unit/version_test.py 2014-07-30 21:48:57.000000000 +0200 @@ -29,14 +29,17 @@ def test_version_parsing(self): strip_initial_non_numbers_regex = re.compile(r'(?:[^\d]+)?(?P<vs>.*)') expect = ( - ('v0.12.0-19-g767d4f9', (0, 12, 0, 0, 19, 'g767d4f9'), None), - ('v0.12.0-85-g2880105', (0, 12, 0, 0, 85, 'g2880105'), None), + ('v0.12.0-19-g767d4f9', (0, 12, 0, 0, 0, 19, 'g767d4f9'), None), + ('v0.12.0-85-g2880105', (0, 12, 0, 0, 0, 85, 'g2880105'), None), ('debian/0.11.1+ds-1-3-ga0afcbd', - (0, 11, 1, 0, 3, 'ga0afcbd'), '0.11.1-3-ga0afcbd'), - ('0.12.1', (0, 12, 1, 0, 0, None), None), - ('0.12.1', (0, 12, 1, 0, 0, None), None), - ('0.17.0rc1', (0, 17, 0, 1, 0, None), None), - ('v0.17.0rc1-1-g52ebdfd', (0, 17, 0, 1, 1, 'g52ebdfd'), None), + (0, 11, 1, 0, 0, 3, 'ga0afcbd'), '0.11.1-3-ga0afcbd'), + ('0.12.1', (0, 12, 1, 0, 0, 0, None), None), + ('0.12.1', (0, 12, 1, 0, 0, 0, None), None), + ('0.17.0rc1', (0, 17, 0, 0, 1, 0, None), None), + ('v0.17.0rc1-1-g52ebdfd', (0, 17, 0, 0, 1, 1, 'g52ebdfd'), None), + ('v2014.1.4.1', (2014, 1, 4, 1, 0, 0, None), None), + ('v2014.1.4.1rc3-n/a-abcdefgh', (2014, 1, 4, 1, 3, -1, 'abcdefgh'), None), + ('v3.4.1.1', (3, 4, 1, 1, 0, 0, None), None) ) @@ -46,9 +49,7 @@ saltstack_version.full_info, full_info ) if version is None: - version = \ - strip_initial_non_numbers_regex.search(vs).group('vs') - + version = strip_initial_non_numbers_regex.search(vs).group('vs') self.assertEqual(saltstack_version.string, version) def test_version_comparison(self): @@ -59,10 +60,12 @@ ('v0.17.0', 'v0.17.0rc1'), ('Hydrogen', '0.17.0'), ('Helium', 'Hydrogen'), + ('v2014.1.4.1-n/a-abcdefgh', 'v2014.1.4.1rc3-n/a-abcdefgh'), + ('v2014.1.4.1-1-abcdefgh', 'v2014.1.4.1-n/a-abcdefgh') ) - for v1, v2 in examples: - self.assertTrue(SaltStackVersion.parse(v1) > v2) - self.assertTrue(SaltStackVersion.parse(v2) < v1) + for higher_version, lower_version in examples: + self.assertTrue(SaltStackVersion.parse(higher_version) > lower_version) + self.assertTrue(SaltStackVersion.parse(lower_version) < higher_version) def test_unparsable_version(self): with self.assertRaises(ValueError): ++++++ use-forking-daemon.patch ++++++ --- /var/tmp/diff_new_pack.c7tU4M/_old 2014-07-31 10:04:41.000000000 +0200 +++ /var/tmp/diff_new_pack.c7tU4M/_new 2014-07-31 10:04:41.000000000 +0200 @@ -1,7 +1,7 @@ -Index: salt-2014.1.7/pkg/salt-master.service +Index: salt-2014.1.8/pkg/salt-master.service =================================================================== ---- salt-2014.1.7.orig/pkg/salt-master.service -+++ salt-2014.1.7/pkg/salt-master.service +--- salt-2014.1.8.orig/pkg/salt-master.service ++++ salt-2014.1.8/pkg/salt-master.service @@ -3,8 +3,10 @@ Description=The Salt Master Server After=syslog.target network.target -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de