Changes to 'refs/tags/spacewalk-backend-0.6.29-1'
by Jan Pazdziora
Tag 'spacewalk-backend-0.6.29-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2009-08-05 08:08 +0000
Tagging package [spacewalk-backend] version [0.6.29-1] in directory [backend/].
Changes since spacewalk-setup-0.6.18-1:
Jan Pazdziora (2):
reporting: add the entitlements report.
Automatic commit of package [spacewalk-backend] release [0.6.29-1].
Justin Sherrill (2):
enhancing logging mechanism for spacewalk-repo-sync
updating repo-sync schema to better conform with new schema standards, also adding deps
Partha Aji (2):
514291 - Fix for KS by IP
Fixed unit tests
Pradeep Kilambi (4):
Fixing the upgrades to default to sha1 for already existing channels
Merge branch 'master' of ssh://pkilambi@git.fedorahosted.org/git/spacewalk
being cautious
494019 - Fixing the registration on python 2.6 to not include dbus.String objects in hardware profile as new xmlrpclib _dump method validates based on __dict__ on value.
Shannon Hughes (1):
514800 - added logic to check for channel managers per cid
---
backend/satellite_tools/reports/data/entitlements | 42 ++++++++
backend/satellite_tools/reposync.py | 19 ++-
backend/spacewalk-backend.spec | 34 ++++++-
client/rhel/rhn-client-tools/src/up2date_client/hardware.py | 10 +-
java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java | 2
java/code/src/com/redhat/rhn/domain/channel/Channel.hbm.xml | 6 -
java/code/src/com/redhat/rhn/frontend/action/channel/manage/ChannelPackageMenuAction.java | 4
java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java | 48 ++++++----
java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java | 19 +++
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 3
java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java | 27 +++++
java/code/src/com/redhat/rhn/manager/download/DownloadManager.java | 17 +++
java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java | 12 +-
java/code/src/com/redhat/rhn/manager/kickstart/SSMScheduleCommand.java | 8 +
java/code/src/com/redhat/rhn/taskomatic/task/RepoSyncTask.java | 9 +
java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp | 7 +
rel-eng/packages/spacewalk-backend | 2
schema/spacewalk/common/tables/rhnChannelContentSource.sql | 21 +---
schema/spacewalk/common/tables/rhnContentSourceType.sql | 14 +-
schema/spacewalk/common/tables/tables.deps | 1
schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/191-rhnChannel.sql | 7 +
schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/191-rhnContentSourceType.sql | 16 +--
schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/192-rhnChannelContentSource.sql | 29 ++----
23 files changed, 257 insertions(+), 100 deletions(-)
---
14 years, 8 months
2 commits - backend/satellite_tools backend/spacewalk-backend.spec rel-eng/packages
by Jan Pazdziora
backend/satellite_tools/reports/data/entitlements | 42 ++++++++++++++++++++++
backend/spacewalk-backend.spec | 34 +++++++++++++++++
rel-eng/packages/spacewalk-backend | 2 -
3 files changed, 76 insertions(+), 2 deletions(-)
New commits:
commit 01651a58452d0efd8c1ddb3232b3e83daac81208
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Aug 5 10:07:59 2009 +0200
Automatic commit of package [spacewalk-backend] release [0.6.29-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 4bd53ae..5bae3f0 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -7,7 +7,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 0.6.28
+Version: 0.6.29
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -579,6 +579,38 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Wed Aug 05 2009 Jan Pazdziora 0.6.29-1
+- reporting: add the entitlements report
+- enhancing logging mechanism for spacewalk-repo-sync (jsherril(a)redhat.com)
+- Merge branch 'master' into repo-sync (jsherril(a)redhat.com)
+- Patch: Selinux Context support for config files (joshua.roys(a)gtri.gatech.edu)
+- merge conflict (jsherril(a)redhat.com)
+- adding newline to error message output (jsherril(a)redhat.com)
+- fixing small method call in reposync (jsherril(a)redhat.com)
+- fixing specfile to create directory for reposync (jsherril(a)redhat.com)
+- fixing small whitespace error with reposync (jsherril(a)redhat.com)
+- adding better logging for spacewalk-repo-sync (jsherril(a)redhat.com)
+- 467281 - Instead of checksing for the start now we cechk if tools is in the
+ channel label. This is not a perfect solution but atleast covers few more
+ cases. An ideal solution would be to add some kind of a relation ship between
+ parent and child signifying that this is a tools channel for a given parent.
+ (pkilambi(a)redhat.com)
+- 505559 - spacewalk-debug now captures database tablespace usage report
+ (pkilambi(a)redhat.com)
+- making the logging a bit cleaner (jsherril(a)redhat.com)
+- fixing some import things to actually work on an installed system
+ (jsherril(a)redhat.com)
+- adding logging, cache clearing, and a few fixes to reposync
+ (jsherril(a)redhat.com)
+- adding makefile to repo_plugins (pkilambi(a)redhat.com)
+- updating spacewalk backend spec file with reposync stuff
+ (pkilambi(a)redhat.com)
+- updating Makefile with reposync files (pkilambi(a)redhat.com)
+- some clean up on repo sync stuff (pkilambi(a)redhat.com)
+- adding repo sync task and other UI bits for spacewalk repo sync
+ (jsherril(a)redhat.com)
+- backend/satellite_tools/repo_plugins/yum_src.py (jsherril(a)redhat.com)
+
* Wed Jul 29 2009 Pradeep Kilambi <pkilambi(a)redhat.com> 0.6.28-1
-
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index f5f347c..5a80b49 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-0.6.28-1 backend/
+0.6.29-1 backend/
commit 02909510452b40413df577f961699220bdba146a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Aug 5 10:06:18 2009 +0200
reporting: add the entitlements report.
Currently, fields
organization_id
organization
entitlement_type
entitlement
used
are shown, for system and channel entitlements.
diff --git a/backend/satellite_tools/reports/data/entitlements b/backend/satellite_tools/reports/data/entitlements
new file mode 100755
index 0000000..23ba37b
--- /dev/null
+++ b/backend/satellite_tools/reports/data/entitlements
@@ -0,0 +1,42 @@
+
+columns:
+
+ organization_id
+ organization
+ entitlement_type
+ entitlement
+ used
+
+multival_columns:
+
+ organization_id
+ entitlement_type
+ entitlement
+
+sql:
+
+ select organization_id,
+ web_customer.name as organization,
+ entitlement_type,
+ entitlement,
+ used
+ from (
+ select rhnprivatechannelfamily.org_id as organization_id,
+ 'channel' as entitlement_type,
+ rhnchannelfamily.name as entitlement,
+ rhnprivatechannelfamily.current_members as used
+ from rhnchannelfamily, rhnprivatechannelfamily
+ where rhnchannelfamily.id = rhnprivatechannelfamily.channel_family_id
+ union all
+ select rhnservergroup.org_id as organization_id,
+ 'system' as entitlement_type,
+ rhnservergrouptype.name as entitlement,
+ rhnservergroup.current_members as used
+ from rhnservergroup, rhnservergrouptype
+ where rhnservergroup.group_type = rhnservergrouptype.id
+ ) entitlements, web_customer
+ where entitlements.organization_id = web_customer.id
+ order by entitlements.organization_id,
+ case when entitlement_type = 'channel' then 1 else 0 end,
+ entitlement
+
14 years, 8 months
java/code
by Partha Aji
java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit d6861f34979468dedc790813bc9e86ac70dda7ad
Author: Partha Aji <paji(a)redhat.com>
Date: Tue Aug 4 19:30:12 2009 -0400
Fixed unit tests
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
index 6b3230a..9c7d3c1 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
@@ -299,6 +299,8 @@ public class KickstartScheduleCommand extends BaseSystemOperation {
}
this.setKickstartServerName(kickstartServerNameIn);
+ isDhcp = true;
+ networkInterface = LINK_NETWORK_TYPE;
}
14 years, 8 months
Branch 'VADER' - java/code
by Partha Aji
java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit 7ec8393f3589575436eb6bdf8c67ad5df4fd2a8b
Author: Partha Aji <paji(a)redhat.com>
Date: Tue Aug 4 19:30:12 2009 -0400
Fixed unit tests
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
index 60d4667..ed2e390 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
@@ -299,6 +299,8 @@ public class KickstartScheduleCommand extends BaseSystemOperation {
}
this.setKickstartServerName(kickstartServerNameIn);
+ isDhcp = true;
+ networkInterface = LINK_NETWORK_TYPE;
}
14 years, 8 months
java/code
by Partha Aji
java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java | 10 ++++------
java/code/src/com/redhat/rhn/manager/kickstart/SSMScheduleCommand.java | 8 +++++---
2 files changed, 9 insertions(+), 9 deletions(-)
New commits:
commit edc55c24fa454001d5a5989e799147e0f4cc368f
Author: Partha Aji <paji(a)redhat.com>
Date: Tue Aug 4 18:56:28 2009 -0400
514291 - Fix for KS by IP
This fix in addition to the previous commit related to this bug
will make sure systems that were not kickstarted successfully by SSM
KS by IP will correctly get reported as failed.
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
index f6391d2..6b3230a 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
@@ -1390,17 +1390,15 @@ public class KickstartScheduleCommand extends BaseSystemOperation {
* @param networkInterfaceIn The staticDevice to set.
*/
public void setNetworkDevice(String networkType, String networkInterfaceIn) {
- isDhcp = DHCP_NETWORK_TYPE.equals(networkType) ||
- StringUtils.isBlank(networkType) ||
- LINK_NETWORK_TYPE.equals(networkType);
- if (StringUtils.isBlank(networkType) ||
- networkType.equals(LINK_NETWORK_TYPE)) {
+ if (StringUtils.isBlank(networkType) ||
+ LINK_NETWORK_TYPE.equals(networkType)) {
+ isDhcp = true;
networkInterface = LINK_NETWORK_TYPE;
}
else {
+ isDhcp = DHCP_NETWORK_TYPE.equals(networkType);
networkInterface = networkInterfaceIn;
}
-
}
/**
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/SSMScheduleCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/SSMScheduleCommand.java
index 90e4a4a..9de43bb 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/SSMScheduleCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/SSMScheduleCommand.java
@@ -180,7 +180,7 @@ public class SSMScheduleCommand {
//an IP Range was not found for the ip address of this system
// and no org default was set. In the future maybe we should handle this
// but for now, we'll just move on
- return null;
+ return new ValidatorError("no.kickstart.profiles");
}
KickstartScheduleCommand com;
@@ -218,8 +218,10 @@ public class SSMScheduleCommand {
ValidatorError error = com.store();
-
- this.scheduledActions.add(com.getScheduledAction());
+ if (error == null) {
+ this.scheduledActions.add(com.getScheduledAction());
+ }
+
return error;
}
14 years, 8 months
Branch 'VADER' - java/code
by Partha Aji
java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit 74152ee29c22324f125f6e9902664274380db2a6
Author: Partha Aji <paji(a)redhat.com>
Date: Tue Aug 4 19:13:55 2009 -0400
backing out a change made in commit 15e3be8cc264f2ce9db9c87bc67640ad12bca900
As a fix for bug 514291 we did more than just fixing it, we did some mucking
with cobbler only.. as in we said if cobbler only profile is selected process
the network selections similar to the regular profiles.. But I am not sure this
is tested well enough... So backing out that part of the commit. It will exist in master
not here though.. We can always port it back if its a issue
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
index 075d4bd..60d4667 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
@@ -934,6 +934,9 @@ public class KickstartScheduleCommand extends BaseSystemOperation {
* @return extraOptions that will be appended to the Kickstart.
*/
public String getExtraOptions() {
+ if (isCobblerOnly()) {
+ return StringUtils.defaultString(kernelOptions);
+ }
StringBuilder retval = new StringBuilder();
String kOptions = StringUtils.defaultString(kernelOptions);
/** Some examples:
14 years, 8 months
Branch 'VADER' - java/code
by Partha Aji
java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java | 10 ++++------
java/code/src/com/redhat/rhn/manager/kickstart/SSMScheduleCommand.java | 8 +++++---
2 files changed, 9 insertions(+), 9 deletions(-)
New commits:
commit 311a6ccb44710cf1d8ef1c57d470634a9010bee3
Author: Partha Aji <paji(a)redhat.com>
Date: Tue Aug 4 18:56:28 2009 -0400
514291 - Fix for KS by IP
This fix in addition to the previous commit related to this bug
will make sure systems that were not kickstarted successfully by SSM
KS by IP will correctly get reported as failed.
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
index c7e74f0..075d4bd 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
@@ -1390,17 +1390,15 @@ public class KickstartScheduleCommand extends BaseSystemOperation {
* @param networkInterfaceIn The staticDevice to set.
*/
public void setNetworkDevice(String networkType, String networkInterfaceIn) {
- isDhcp = DHCP_NETWORK_TYPE.equals(networkType) ||
- StringUtils.isBlank(networkType) ||
- LINK_NETWORK_TYPE.equals(networkType);
- if (StringUtils.isBlank(networkType) ||
- networkType.equals(LINK_NETWORK_TYPE)) {
+ if (StringUtils.isBlank(networkType) ||
+ LINK_NETWORK_TYPE.equals(networkType)) {
+ isDhcp = true;
networkInterface = LINK_NETWORK_TYPE;
}
else {
+ isDhcp = DHCP_NETWORK_TYPE.equals(networkType);
networkInterface = networkInterfaceIn;
}
-
}
/**
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/SSMScheduleCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/SSMScheduleCommand.java
index 90e4a4a..9de43bb 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/SSMScheduleCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/SSMScheduleCommand.java
@@ -180,7 +180,7 @@ public class SSMScheduleCommand {
//an IP Range was not found for the ip address of this system
// and no org default was set. In the future maybe we should handle this
// but for now, we'll just move on
- return null;
+ return new ValidatorError("no.kickstart.profiles");
}
KickstartScheduleCommand com;
@@ -218,8 +218,10 @@ public class SSMScheduleCommand {
ValidatorError error = com.store();
-
- this.scheduledActions.add(com.getScheduledAction());
+ if (error == null) {
+ this.scheduledActions.add(com.getScheduledAction());
+ }
+
return error;
}
14 years, 8 months
client/rhel
by Pradeep Kilambi
client/rhel/rhn-client-tools/src/up2date_client/hardware.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit d9ae87f569febad86f0d33ce6f41bf90046c3fd2
Author: Pradeep Kilambi <pkilambi(a)redhat.com>
Date: Tue Aug 4 17:36:45 2009 -0400
494019 - Fixing the registration on python 2.6 to not include dbus.String objects in hardware profile as new xmlrpclib _dump method validates based on __dict__ on value.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/hardware.py b/client/rhel/rhn-client-tools/src/up2date_client/hardware.py
index acc2746..5d7cdba 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/hardware.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/hardware.py
@@ -137,7 +137,7 @@ def process_hal_nodes(node):
dev = {}
dev['class'] = node.classification
#get bus
- dev['bus'] = get_device_bus(node)
+ dev['bus'] = str(get_device_bus(node))
#get scsi info
if dev['bus'] == 'scsi':
@@ -151,15 +151,15 @@ def process_hal_nodes(node):
dev['prop4'] = parent.properties['scsi.lun']
- dev['driver'] = get_device_driver(node)
+ dev['driver'] = str(get_device_driver(node))
device_path = get_device_path(node)
if device_path:
- dev['device'] = device_path
+ dev['device'] = str(device_path)
- dev['desc'] = get_device_description(node)
+ dev['desc'] = str(get_device_description(node))
- dev['pciType'] = get_device_pcitype(node)
+ dev['pciType'] = str(get_device_pcitype(node))
dev['detached'] = 0
kudzu_list.append(dev)
14 years, 8 months
schema/spacewalk
by Justin Sherrill
schema/spacewalk/common/tables/rhnChannelContentSource.sql | 21 ++-----
schema/spacewalk/common/tables/rhnContentSourceType.sql | 14 +---
schema/spacewalk/common/tables/tables.deps | 1
schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/191-rhnContentSourceType.sql | 16 ++---
schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/192-rhnChannelContentSource.sql | 29 ++++------
5 files changed, 32 insertions(+), 49 deletions(-)
New commits:
commit 8d101a35ee4314457144d90a0a10f2d761d47533
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Tue Aug 4 16:55:09 2009 -0400
updating repo-sync schema to better conform with new schema standards, also adding deps
diff --git a/schema/spacewalk/common/tables/rhnChannelContentSource.sql b/schema/spacewalk/common/tables/rhnChannelContentSource.sql
index f0b30a5..93c1b81 100644
--- a/schema/spacewalk/common/tables/rhnChannelContentSource.sql
+++ b/schema/spacewalk/common/tables/rhnChannelContentSource.sql
@@ -19,26 +19,19 @@
create table
rhnChannelContentSource
(
- id number
- constraint rhn_ccs_id_nn not null
+ id number NOT NULL
constraint rhn_ccs_id_pk primary key,
- channel_id number
- constraint rhn_ccs_c_nn not null
+ channel_id number NOT NULL
constraint rhn_ccs_c_fk
references rhnChannel(id) on delete cascade,
- type_id number
- constraint rhn_ccs_type_nn not null
+ type_id number NOT NULL
constraint rhn_ccs_type_fk
references rhnContentSourceType(id),
- source_url varchar2(512)
- constraint rhn_ccs_url_nn not null,
- label varchar2(64)
- constraint rhn_ccs_l_nn not null,
+ source_url varchar2(512) NOT NULL,
+ label varchar2(64) NOT NULL,
last_synced date,
- created date default(sysdate)
- constraint rhn_ccs_cre_nn not null,
- modified date default(sysdate)
- constraint rhn_ccs_mod_nn not null
+ created date default(sysdate) NOT NULL,
+ modified date default(sysdate) NOT NULL
)
enable row movement
;
diff --git a/schema/spacewalk/common/tables/rhnContentSourceType.sql b/schema/spacewalk/common/tables/rhnContentSourceType.sql
index 6e0ce24..aeba44d 100644
--- a/schema/spacewalk/common/tables/rhnContentSourceType.sql
+++ b/schema/spacewalk/common/tables/rhnContentSourceType.sql
@@ -19,17 +19,13 @@
create table
rhnContentSourceType
(
- id number
- constraint rhn_cst_id_nn not null
+ id number NOT NULL
constraint rhn_cst_id_pk primary key,
- label varchar2(32)
- constraint rhn_cst_label_nn not null
+ label varchar2(32) NOT NULL
constraint rhn_cst_label_uq unique,
- created date default(sysdate)
- constraint rhn_cst_created_nn not null,
- modified date default(sysdate)
- constraint rhn_cst_modified_nn not null
-)
+ created date default(sysdate) NOT NULL,
+ modified date default(sysdate) NOT NULL
+)
enable row movement
;
diff --git a/schema/spacewalk/common/tables/tables.deps b/schema/spacewalk/common/tables/tables.deps
index 0dd3d79..2bae2aa 100644
--- a/schema/spacewalk/common/tables/tables.deps
+++ b/schema/spacewalk/common/tables/tables.deps
@@ -66,6 +66,7 @@ rhnChannelPackageArchCompat :: rhnPackageArch rhnChannelArch
rhnChannelPermission :: rhnChannelPermissionRole rhnChannel web_contact
rhnChannelRelationship :: rhnRelationshipType rhnChannel
rhnChannelTrust :: rhnChannel
+rhnChannelContentSource :: rhnChannel rhnContentSourceType
rhnClientCapability :: rhnClientCapabilityName
rhnClientOptionVersionMap :: rhnClientConfigOption rhnPackageEVR
rhnConfigFile :: rhnConfigChannel rhnConfigFileState rhnConfigFileName
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/191-rhnContentSourceType.sql b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/191-rhnContentSourceType.sql
index 546a3e1..889f747 100644
--- a/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/191-rhnContentSourceType.sql
+++ b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/191-rhnContentSourceType.sql
@@ -19,20 +19,18 @@
create table
rhnContentSourceType
(
- id number
- constraint rhn_cst_id_nn not null
+ id number NOT NULL
constraint rhn_cst_id_pk primary key,
- label varchar2(32)
- constraint rhn_cst_label_nn not null
+ label varchar2(32) NOT NULL
constraint rhn_cst_label_uq unique,
- created date default(sysdate)
- constraint rhn_cst_created_nn not null,
- modified date default(sysdate)
- constraint rhn_cst_modified_nn not null
+ created date default(sysdate) NOT NULL,
+ modified date default(sysdate) NOT NULL
)
- enable row movement
+ enable row movement
;
+
+
create sequence rhn_content_source_type_id_seq start with 500;
create index rhn_ccst_id_l_idx
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/192-rhnChannelContentSource.sql b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/192-rhnChannelContentSource.sql
index ccf5cb8..03ce034 100644
--- a/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/192-rhnChannelContentSource.sql
+++ b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/192-rhnChannelContentSource.sql
@@ -16,34 +16,29 @@
--
--
+
create table
rhnChannelContentSource
(
- id number
- constraint rhn_ccs_id_nn not null
- constraint rhn_ccs_id_pk primary key,
- channel_id number
- constraint rhn_ccs_c_nn not null
+ id number NOT NULL
+ constraint rhn_ccs_id_pk primary key,
+ channel_id number NOT NULL
constraint rhn_ccs_c_fk
references rhnChannel(id) on delete cascade,
- type_id number
- constraint rhn_ccs_type_nn not null
+ type_id number NOT NULL
constraint rhn_ccs_type_fk
references rhnContentSourceType(id),
- source_url varchar2(512)
- constraint rhn_ccs_url_nn not null,
- label varchar2(64)
- constraint rhn_ccs_l_nn not null,
- last_synced date,
- created date default(sysdate)
- constraint rhn_ccs_cre_nn not null,
- modified date default(sysdate)
- constraint rhn_ccs_mod_nn not null
+ source_url varchar2(512) NOT NULL,
+ label varchar2(64) NOT NULL,
+ last_synced date,
+ created date default(sysdate) NOT NULL,
+ modified date default(sysdate) NOT NULL
)
- enable row movement
+ enable row movement
;
+
create sequence rhn_chan_content_src_id_seq start with 500;
14 years, 8 months
backend/satellite_tools java/code
by Justin Sherrill
backend/satellite_tools/reposync.py | 19 ++-
java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java | 2
java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java | 48 ++++++----
java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java | 19 +++
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 3
java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java | 27 +++++
java/code/src/com/redhat/rhn/manager/download/DownloadManager.java | 17 +++
java/code/src/com/redhat/rhn/taskomatic/task/RepoSyncTask.java | 9 +
java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp | 7 +
9 files changed, 119 insertions(+), 32 deletions(-)
New commits:
commit f7a1384f0287e4f02b762e5ec438a28bf5a1efef
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Tue Aug 4 13:57:03 2009 -0400
enhancing logging mechanism for spacewalk-repo-sync
diff --git a/backend/satellite_tools/reposync.py b/backend/satellite_tools/reposync.py
index 80f830e..93e18e1 100644
--- a/backend/satellite_tools/reposync.py
+++ b/backend/satellite_tools/reposync.py
@@ -13,7 +13,7 @@
# granted to use or replicate Red Hat trademarks that are incorporated
# in this software or its documentation.
#
-import sys, os, time
+import sys, os, time, grp
from optparse import OptionParser
from common import rhnLib
from server import rhnPackage, rhnSQL, rhnChannel, rhnPackageUpload
@@ -45,10 +45,13 @@ class RepoSync:
log_filename = 'reposync.log'
if options.channel_label and options.label:
date = time.localtime()
- datestr = '%s.%s.%s-%s:%s:%s' % (date.tm_year, date.tm_mon, date.tm_mday, date.tm_hour, date.tm_min, date.tm_sec)
+ datestr = '%d.%02d.%02d-%02d:%02d:%02d' % (date.tm_year, date.tm_mon, date.tm_mday, date.tm_hour, date.tm_min, date.tm_sec)
log_filename = options.channel_label + '-' + options.label + '-' + datestr + '.log'
rhnLog.initLOG(default_log_location + log_filename)
+ #os.fchown isn't in 2.4 :/
+ os.system("chgrp apache " + default_log_location + log_filename)
+
quit = False
if not options.url:
@@ -64,11 +67,13 @@ class RepoSync:
quit = True
self.error_msg("--label must be specified")
+ self.log_msg("\nSync started: %s" % (time.asctime(time.localtime())))
+ self.log_msg(str(sys.argv))
+
+
if quit:
sys.exit(1)
- self.log_msg(str(sys.argv))
-
self.type = options.type
self.url = options.url
self.channel_label = options.channel_label
@@ -80,10 +85,9 @@ class RepoSync:
print "Channel does not exist or is not custom"
sys.exit(1)
-
-
self.plugin = self.load_plugin()(self.url, self.channel_label + "-" + self.repo_label)
self.import_packages(self.plugin.list_packages())
+ self.print_msg("Sync complete")
def process_args(self):
self.parser = OptionParser()
@@ -119,7 +123,8 @@ class RepoSync:
pack.version, pack.release, '', pack.arch]):
to_download.append(pack)
-
+ if len(to_download) == 0:
+ self.print_msg("No new packages to download.")
for (index, pack) in enumerate(to_download):
"""download each package"""
try:
diff --git a/java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java b/java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java
index 1002d2f..976b902 100644
--- a/java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java
+++ b/java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java
@@ -146,7 +146,7 @@ public class ConfigDefaults {
public static final String KICKSTART_NETWORK_INTERFACE = "kickstart.default_interface";
public static final String SPACEWALK_REPOSYNC_PATH = "spacewalk_reposync_path";
- public static final String SPACEWALK_REPOSYNC_LOG_FILE = "spacewalk_reposync_logfile";
+ public static final String SPACEWALK_REPOSYNC_LOG_PATH = "spacewalk_reposync_logpath";
private ConfigDefaults() {
}
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java
index 257c8ee..bbf9c34 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java
@@ -14,24 +14,6 @@
*/
package com.redhat.rhn.frontend.action.channel.manage;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts.action.ActionErrors;
-import org.apache.struts.action.ActionForm;
-import org.apache.struts.action.ActionForward;
-import org.apache.struts.action.ActionMapping;
-import org.apache.struts.action.ActionMessage;
-import org.apache.struts.action.ActionMessages;
-import org.apache.struts.action.DynaActionForm;
-
import com.redhat.rhn.common.db.datasource.DataResult;
import com.redhat.rhn.common.localization.LocalizationService;
import com.redhat.rhn.common.security.PermissionException;
@@ -57,9 +39,28 @@ import com.redhat.rhn.manager.channel.ChannelManager;
import com.redhat.rhn.manager.channel.CreateChannelCommand;
import com.redhat.rhn.manager.channel.InvalidGPGFingerprintException;
import com.redhat.rhn.manager.channel.UpdateChannelCommand;
+import com.redhat.rhn.manager.download.DownloadManager;
import com.redhat.rhn.manager.system.SystemManager;
import com.redhat.rhn.manager.user.UserManager;
+import org.apache.struts.action.ActionErrors;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ActionMessages;
+import org.apache.struts.action.DynaActionForm;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
/**
* EditChannelAction
@@ -125,6 +126,7 @@ public class EditChannelAction extends RhnAction implements Listable {
createSuccessMessage(request, "message.channelupdated",
form.getString("name"));
}
+
//did they enable per user subscriptions?
String sub = (String)form.get("per_user_subscriptions");
@@ -167,6 +169,11 @@ public class EditChannelAction extends RhnAction implements Listable {
params);
}
+ if (errors.isEmpty() && form.get("sync_repo") != null) {
+ createSuccessMessage(request, "message.syncscheduled",
+ form.getString("name"));
+ }
+
return getStrutsDelegate().forwardParams(
mapping.findForward("success"), params);
}
@@ -597,6 +604,11 @@ public class EditChannelAction extends RhnAction implements Listable {
cs.getLastSynced());
}
request.setAttribute("last_sync", lastSync);
+ if (ChannelManager.getLatestSyncLogFile(cs) != null) {
+ request.setAttribute("log_url",
+ DownloadManager.getChannelSyncLogDownloadPath(cs,
+ ctx.getLoggedInUser()));
+ }
}
diff --git a/java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java b/java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java
index 3679640..d1a88a3 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java
@@ -22,6 +22,7 @@ import com.redhat.rhn.common.util.MD5Sum;
import com.redhat.rhn.common.util.download.ByteArrayStreamInfo;
import com.redhat.rhn.domain.channel.Channel;
import com.redhat.rhn.domain.channel.ChannelFactory;
+import com.redhat.rhn.domain.channel.ContentSource;
import com.redhat.rhn.domain.kickstart.KickstartFactory;
import com.redhat.rhn.domain.kickstart.KickstartSession;
import com.redhat.rhn.domain.kickstart.KickstartSessionState;
@@ -35,6 +36,7 @@ import com.redhat.rhn.domain.rhnpackage.PatchSet;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.domain.user.UserFactory;
import com.redhat.rhn.frontend.struts.RhnHelper;
+import com.redhat.rhn.manager.channel.ChannelManager;
import com.redhat.rhn.manager.download.DownloadManager;
import com.redhat.rhn.manager.download.UnknownDownloadTypeException;
@@ -45,7 +47,9 @@ import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DownloadAction;
+import java.io.BufferedReader;
import java.io.File;
+import java.io.FileReader;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
@@ -317,6 +321,21 @@ public class DownloadFile extends DownloadAction {
return getStreamForText(patch.getReadme().getBytes(1L,
(int) patch.getReadme().length()));
}
+ else if (type.equals(DownloadManager.DOWNLOAD_TYPE_REPO_LOG)) {
+ ContentSource cs = ChannelFactory.lookupContentSource(fileId);
+ ChannelManager.verifyChannelAdmin(user, fileId);
+ File file = new File(ChannelManager.getLatestSyncLogFile(cs));
+
+ StringBuilder output = new StringBuilder();
+ BufferedReader input = new BufferedReader(new FileReader(file));
+ String line;
+ while ((line = input.readLine()) != null) {
+ output.append(line);
+ output.append("\n");
+ }
+
+ return getStreamForText(output.toString().getBytes());
+ }
}
throw new UnknownDownloadTypeException("The specified download type " + type +
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
index ab5ce38..63108c2 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
@@ -8252,6 +8252,9 @@ Follow this url to see the full list of inactive systems:
<trans-unit id="message.channelupdated">
<source>Channel <strong>{0}</strong> updated.</source>
</trans-unit>
+ <trans-unit id="message.syncscheduled">
+ <source>Repository Sync Scheduled.</source>
+ </trans-unit>
<trans-unit id="message.channelsubscribers">
<source>Per-User subscription restrictions may be applied in the Subscribers tab</source>
</trans-unit>
diff --git a/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java b/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
index 32ddadb..aec5e6e 100644
--- a/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
+++ b/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
@@ -35,6 +35,7 @@ import com.redhat.rhn.domain.channel.ChannelFamily;
import com.redhat.rhn.domain.channel.ChannelFamilyFactory;
import com.redhat.rhn.domain.channel.ChannelVersion;
import com.redhat.rhn.domain.channel.ClonedChannel;
+import com.redhat.rhn.domain.channel.ContentSource;
import com.redhat.rhn.domain.channel.DistChannelMap;
import com.redhat.rhn.domain.channel.InvalidChannelRoleException;
import com.redhat.rhn.domain.channel.ProductName;
@@ -2783,4 +2784,30 @@ public class ChannelManager extends BaseManager {
return fileModifiedDate;
}
+
+ /**
+ * get the latest log file for spacewalk-repo-sync
+ * @param cs the channel content source you want the latest log file for
+ * @return the string of the filename (fully qualified)
+ */
+ public static String getLatestSyncLogFile(ContentSource cs) {
+
+ String logPath = Config.get().getString(ConfigDefaults.SPACEWALK_REPOSYNC_LOG_PATH,
+ "/var/log/rhn/reposync/");
+ String repoLabel = cs.getLabel();
+
+ File dir = new File(logPath);
+ List<String> possibleList = new ArrayList<String>();
+ for (String file : dir.list()) {
+ if (file.contains(cs.getChannel().getLabel() + '-' + repoLabel)) {
+ possibleList.add(file);
+ }
+ }
+ if (possibleList.isEmpty()) {
+ return null;
+ }
+ Collections.sort(possibleList);
+ return logPath + possibleList.get(possibleList.size() - 1);
+ }
+
}
diff --git a/java/code/src/com/redhat/rhn/manager/download/DownloadManager.java b/java/code/src/com/redhat/rhn/manager/download/DownloadManager.java
index 8d2dc7c..12e469d 100644
--- a/java/code/src/com/redhat/rhn/manager/download/DownloadManager.java
+++ b/java/code/src/com/redhat/rhn/manager/download/DownloadManager.java
@@ -17,6 +17,7 @@ package com.redhat.rhn.manager.download;
import com.redhat.rhn.common.conf.Config;
import com.redhat.rhn.common.conf.ConfigDefaults;
import com.redhat.rhn.common.security.SessionSwap;
+import com.redhat.rhn.domain.channel.ContentSource;
import com.redhat.rhn.domain.rhnpackage.Package;
import com.redhat.rhn.domain.rhnpackage.PackageSource;
import com.redhat.rhn.domain.rhnpackage.Patch;
@@ -43,7 +44,7 @@ public class DownloadManager extends BaseManager {
public static final String DOWNLOAD_TYPE_ISO = "iso";
public static final String DOWNLOAD_TYPE_PATCH_README = "patchreadme";
public static final String DOWNLOAD_TYPE_PATCH_SET_README = "patchsetreadme";
-
+ public static final String DOWNLOAD_TYPE_REPO_LOG = "repolog";
/**
* Get a download path (part of the url) that is used to download a package.
@@ -96,6 +97,20 @@ public class DownloadManager extends BaseManager {
DownloadManager.DOWNLOAD_TYPE_SOURCE);
}
+ /**
+ * Get a download path that is used to download a repo log file.
+ *
+ * @param src the content source
+ * @param user the user
+ * @return the path/url
+ */
+ public static String getChannelSyncLogDownloadPath(ContentSource src,
+ User user) {
+ return getNonExpiringDownloadPath(src.getId(), src.getLabel(), user,
+ DownloadManager.DOWNLOAD_TYPE_REPO_LOG);
+ }
+
+
/**
* Get the an ISO download Path
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/RepoSyncTask.java b/java/code/src/com/redhat/rhn/taskomatic/task/RepoSyncTask.java
index f26278b..57b9f8b 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/RepoSyncTask.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/RepoSyncTask.java
@@ -63,6 +63,10 @@ public class RepoSyncTask implements Job {
throws JobExecutionException {
for (Task task : TaskFactory.listTasks(DISPLAY_NAME)) {
+ //workaround in case task is null (which can happen)
+ if (task == null || task.getData() == null) {
+ continue;
+ }
ContentSource src = ChannelFactory.lookupContentSource(task.getData());
if (log.isInfoEnabled()) {
log.info("Syncing repo " + src.getSourceUrl() + " to channel " +
@@ -76,6 +80,7 @@ public class RepoSyncTask implements Job {
try {
Process p = Runtime.getRuntime().exec(
getSyncCommand(src).toArray(new String[0]));
+ src.setLastSynced(new Date());
p.waitFor();
}
@@ -87,7 +92,6 @@ public class RepoSyncTask implements Job {
log.fatal(e.getMessage());
e.printStackTrace();
}
- src.setLastSynced(new Date());
TaskFactory.removeTask(task);
}
}
@@ -104,9 +108,6 @@ public class RepoSyncTask implements Job {
cmd.add(src.getType().getLabel());
cmd.add("--label");
cmd.add(src.getLabel());
- cmd.add("--logfile");
- cmd.add(Config.get().getString(ConfigDefaults.SPACEWALK_REPOSYNC_LOG_FILE,
- "/var/log/rhn/rhn_reposync.log"));
return cmd;
}
diff --git a/java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp b/java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp
index 022152f..cc1f02a 100644
--- a/java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp
+++ b/java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp
@@ -147,7 +147,12 @@
<bean:message key="channel.edit.jsp.lastsynced"/>:
</th>
<td>
- <c:out value='${last_sync}'/>
+ <c:if test='${not empty log_url}'>
+ <a href='${log_url}'><c:out value='${last_sync}'/></a>
+ </c:if>
+ <c:if test='${empty log_url}'>
+ <c:out value='${last_sync}'/>
+ </c:if>
</td>
</tr>
</c:if>
14 years, 8 months