backend/server/rhnServer/server_kickstart.py | 39 ++++++++++++++++-----------
backend/spacewalk-backend.spec | 5 ++-
rel-eng/packages/spacewalk-backend | 2 -
3 files changed, 29 insertions(+), 17 deletions(-)
New commits:
commit 53dad0192e09b740eb00377de48c229aaf21f2a6
Author: Stephen Herr <sherr(a)redhat.com>
Date: Mon Jul 29 18:09:09 2013 -0400
Automatic commit of package [spacewalk-backend] release [2.1.2-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 9007251..50c284e 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -12,7 +12,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 2.1.1
+Version: 2.1.2
Release: 1%{?dist}
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -639,6 +639,9 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Mon Jul 29 2013 Stephen Herr <sherr(a)redhat.com> 2.1.2-1
+- 960550 - the "Deploy confguration files" box is never checked for kickstarts
+
* Thu Jul 25 2013 Michael Mraka <michael.mraka(a)redhat.com> 2.1.1-1
- 803837 - process includepkgs and exclude from yum.conf
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 6346bd8..2723f41 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-2.1.1-1 backend/
+2.1.2-1 backend/
commit 97cc5ff73e34f6ee8ac72160392d812466fab015
Author: Stephen Herr <sherr(a)redhat.com>
Date: Mon Jul 29 18:08:46 2013 -0400
960550 - the "Deploy confguration files" box is never checked for
kickstarts
diff --git a/backend/server/rhnServer/server_kickstart.py
b/backend/server/rhnServer/server_kickstart.py
index 66bf336..4b60379 100644
--- a/backend/server/rhnServer/server_kickstart.py
+++ b/backend/server/rhnServer/server_kickstart.py
@@ -304,6 +304,28 @@ def schedule_virt_pkg_install(server_id, kickstart_session_id):
return action_id
+_query_ak_deploy_config = rhnSQL.Statement("""
+select rt.deploy_configs
+ from rhnKickstartSession ks,
+ rhnKickstartDefaultRegToken kdrt,
+ rhnRegToken rt
+ where ks.kickstart_id = kdrt.kickstart_id
+ and kdrt.regtoken_id = rt.id
+ and ks.id = :session_id
+""")
+# Make sure the activation keys associated with this kickstart profile
+# have enabled deploying config files. Only deploy configs if at least one
+# of them has. This is replacing code that didn't work because the
+# rhnFlags('registration_token') could not be set during the rhn_check call.
+def ks_activation_key_deploy_config(kickstart_session_id):
+ h = rhnSQL.prepare(_query_ak_deploy_config)
+ h.execute(session_id=kickstart_session_id)
+ rows = h.fetchall_dict()
+ for row in rows:
+ if row['deploy_configs'] and row['deploy_configs'] ==
'Y':
+ return True
+ return False
+
_query_schedule_config_files = rhnSQL.Statement("""
insert into rhnActionConfigRevision
(id, action_id, server_id, config_revision_id)
@@ -334,7 +356,8 @@ def schedule_config_deploy(server_id, action_id,
kickstart_session_id,
row = get_kickstart_session_info(kickstart_session_id, server_id)
org_id = row['org_id']
scheduler = row['scheduler']
- deploy_configs = (row['deploy_configs'] == 'Y')
+ deploy_configs = (row['deploy_configs'] == 'Y'
+ and ks_activation_key_deploy_config(kickstart_session_id))
if not deploy_configs:
# Nothing more to do here
@@ -349,20 +372,6 @@ def schedule_config_deploy(server_id, action_id,
kickstart_session_id,
else:
aid = action_id
- tokens_obj = rhnFlags.get("registration_token")
- if not tokens_obj:
- log_debug(3, "Failed to get the registration_token")
- return aid
- else:
- tokens_obj = rhnFlags.get("registration_token")
- deployment = False
- for token in tokens_obj.tokens:
- if token['deploy_configs'] == 'Y':
- deployment = True
- break
- if not deployment:
- return aid
-
next_action_id = rhnAction.schedule_server_action(
server_id,
action_type='configfiles.deploy',