SHA256
1
0
forked from pool/salt
salt/_service:extract_file:enable-with-salt-version-parameter-for-setup.py-scri.patch
Klaus Kämpf e628fd1d19 Accepting request 540260 from systemsmanagement:saltstack:products:unstable.py3
- Update to 2017.7.2
  See https://docs.saltstack.com/en/latest/topics/releases/2017.7.2.html
- Added:
 * enable-with-salt-version-parameter-for-setup.py-scri.patch
- Removed:
 * add-a-salt-minion-service-control-file.patch
 * add-clean_id-function-to-salt.utils.verify.py.patch
 * add-options-for-dockerng.patch
 * add-ssh-option-to-salt-ssh.patch
 * add-unit-test-for-skip-false-values-from-preferred_i.patch
 * add-yum-plugin.patch
 * add-zypp-notify-plugin.patch
 * adding-salt-minion-watchdog-for-sysv-systems-rhel6-a.patch
 * adding-support-for-installing-patches-in-yum-dnf-exe.patch
 * avoid-failures-on-sles-12-sp2-because-of-new-systemd.patch
 * bugfix-jobs-scheduled-to-run-at-a-future-time-stay-p.patch
 * bugfix-unable-to-use-127-as-hostname.patch
 * catching-error-when-pidfile-cannot-be-deleted.patch
 * change-travis-configuration-file-to-use-salt-toaster.patch
 * check-if-byte-strings-are-properly-encoded-in-utf-8.patch
 * clean-up-change-attribute-from-interface-dict.patch
 * do-not-generate-a-date-in-a-comment-to-prevent-rebui.patch
 * enables-salt-minion-watchdog-on-init.d-script-for-sy.patch
 * escape-the-os.sep.patch
 * fix-for-delete_deployment-in-kubernetes-module.patch
 * fix-format-error-bsc-1043111.patch
 * fix-grain-for-os_family-on-suse-series.patch
 * fix-os_family-case-in-unittest.patch
 * fix-regression-in-file.get_managed-add-unit-tests.patch
 * fix-salt-summary-to-count-not-responding-minions-cor.patch

OBS-URL: https://build.opensuse.org/request/show/540260
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:saltstack/salt?expand=0&rev=98
2017-11-10 07:17:55 +00:00

76 lines
3.2 KiB
Diff

From 1949261a504fd01e057b41126d78f142f4977204 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez@suse.com>
Date: Fri, 6 Oct 2017 17:12:15 +0100
Subject: [PATCH 6/6] Enable '--with-salt-version' parameter for setup.py
script
---
setup.py | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/setup.py b/setup.py
index effdc2f230..519f753401 100755
--- a/setup.py
+++ b/setup.py
@@ -183,17 +183,22 @@ class WriteSaltVersion(Command):
'''
def run(self):
- if not os.path.exists(SALT_VERSION_HARDCODED):
+ if not os.path.exists(SALT_VERSION_HARDCODED) or self.distribution.with_salt_version:
# Write the version file
if getattr(self.distribution, 'salt_version_hardcoded_path', None) is None:
print('This command is not meant to be called on it\'s own')
exit(1)
+ if not self.distribution.with_salt_version:
+ salt_version = __saltstack_version__
+ else:
+ salt_version = SaltStackVersion.parse(self.distribution.with_salt_version)
+
# pylint: disable=E0602
open(self.distribution.salt_version_hardcoded_path, 'w').write(
INSTALL_VERSION_TEMPLATE.format(
date=DATE,
- full_version_info=__saltstack_version__.full_info
+ full_version_info=salt_version.full_info
)
)
# pylint: enable=E0602
@@ -731,6 +736,13 @@ class Build(build):
def run(self):
# Run build.run function
build.run(self)
+ if getattr(self.distribution, 'with_salt_version', False):
+ # Write the hardcoded salt version module salt/_version.py
+ self.distribution.salt_version_hardcoded_path = os.path.join(
+ self.build_lib, 'salt', '_version.py'
+ )
+ self.run_command('write_salt_version')
+
if getattr(self.distribution, 'running_salt_install', False):
# If our install attribute is present and set to True, we'll go
# ahead and write our install time python modules.
@@ -839,6 +851,7 @@ class SaltDistribution(distutils.dist.Distribution):
('ssh-packaging', None, 'Run in SSH packaging mode'),
('salt-transport=', None, 'The transport to prepare salt for. Choices are \'zeromq\' '
'\'raet\' or \'both\'. Defaults to \'zeromq\'', 'zeromq')] + [
+ ('with-salt-version=', None, 'Set a fixed version for Salt instead calculating it'),
# Salt's Paths Configuration Settings
('salt-root-dir=', None,
'Salt\'s pre-configured root directory'),
@@ -893,6 +906,9 @@ class SaltDistribution(distutils.dist.Distribution):
self.salt_spm_pillar_dir = None
self.salt_spm_reactor_dir = None
+ # Salt version
+ self.with_salt_version = None
+
self.name = 'salt-ssh' if PACKAGED_FOR_SALT_SSH else 'salt'
self.salt_version = __version__ # pylint: disable=undefined-variable
self.description = 'Portable, distributed, remote execution and configuration management system'
--
2.14.2