Changes to 'refs/tags/spacewalk-java-1.5.52-1'
by Tomas Lestach
Tag 'spacewalk-java-1.5.52-1' created by Tomas Lestach <tlestach(a)redhat.com> at 2011-06-28 16:40 +0000
Tagging package [spacewalk-java] version [1.5.52-1] in directory [java/].
Changes since spacewalk-java-1.5.51-1:
Paresh Mutha (1):
646802 - Fix to have consistent channel name max length to 256
Tomas Lestach (1):
Automatic commit of package [spacewalk-java] release [1.5.52-1].
---
java/code/src/com/redhat/rhn/manager/channel/CreateChannelCommand.java | 2 +-
java/spacewalk-java.spec | 6 +++++-
rel-eng/packages/spacewalk-java | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
---
11 years, 11 months
2 commits - java/code java/spacewalk-java.spec rel-eng/packages
by Tomas Lestach
java/code/src/com/redhat/rhn/manager/channel/CreateChannelCommand.java | 2 +-
java/spacewalk-java.spec | 6 +++++-
rel-eng/packages/spacewalk-java | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
New commits:
commit e091fdcae391c8d0e0eb851c96b42258d66c0eb9
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jun 28 18:40:44 2011 +0200
Automatic commit of package [spacewalk-java] release [1.5.52-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index c88f59c..c0a0fa2 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -17,7 +17,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.5.51
+Version: 1.5.52
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -546,6 +546,10 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Tue Jun 28 2011 Tomas Lestach <tlestach(a)redhat.com> 1.5.52-1
+- 646802 - Fix to have consistent channel name max length to 256
+ (pmutha(a)redhat.com)
+
* Tue Jun 28 2011 Tomas Lestach <tlestach(a)redhat.com> 1.5.51-1
- fix never ending loop, when entering an invalid storage value
(tlestach(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index b268fbd..b016c72 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.5.51-1 java/
+1.5.52-1 java/
commit ee9ae4ad2086eddfffeea862ed2d12f64b0fe2bd
Author: Paresh Mutha <pmutha(a)redhat.com>
Date: Tue Jun 28 18:39:58 2011 +0200
646802 - Fix to have consistent channel name max length to 256
diff --git a/java/code/src/com/redhat/rhn/manager/channel/CreateChannelCommand.java b/java/code/src/com/redhat/rhn/manager/channel/CreateChannelCommand.java
index 163e12c..ab0213c 100644
--- a/java/code/src/com/redhat/rhn/manager/channel/CreateChannelCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/channel/CreateChannelCommand.java
@@ -36,7 +36,7 @@ import java.util.regex.Pattern;
public class CreateChannelCommand {
public static final int CHANNEL_NAME_MIN_LENGTH = 6;
- public static final int CHANNEL_NAME_MAX_LENGTH = 64;
+ public static final int CHANNEL_NAME_MAX_LENGTH = 256;
public static final int CHANNEL_LABEL_MIN_LENGTH = 6;
protected static final String CHANNEL_NAME_REGEX =
11 years, 11 months
Changes to 'refs/tags/spacewalk-java-1.5.51-1'
by Tomas Lestach
Tag 'spacewalk-java-1.5.51-1' created by Tomas Lestach <tlestach(a)redhat.com> at 2011-06-28 16:22 +0000
Tagging package [spacewalk-java] version [1.5.51-1] in directory [java/].
Changes since yum-rhn-plugin-1.5.7-1:
Tomas Lestach (4):
699505 - introduce channel.software.setUserManagable and channel.software.isUserManagable API calls
rename localStorageMegabytes -> localStorageGigabytes
fix never ending loop, when entering an invalid storage value
Automatic commit of package [spacewalk-java] release [1.5.51-1].
Uwe Gansert (2):
prevent setting virtual bridge to null
storage isn't set in MB, but in GB
---
java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java | 19 +-
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 2
java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java | 82 ++++++++++
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 14 -
java/code/src/com/redhat/rhn/manager/action/ActionManager.java | 8
java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java | 70 ++++++++
java/code/src/com/redhat/rhn/manager/kickstart/ProvisionVirtualInstanceCommand.java | 2
java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/ks-wizard.jspf | 4
java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/virt-options.jspf | 2
java/code/webapp/WEB-INF/struts-config.xml | 2
java/spacewalk-java.spec | 11 +
rel-eng/packages/spacewalk-java | 2
12 files changed, 193 insertions(+), 25 deletions(-)
---
11 years, 11 months
java/spacewalk-java.spec rel-eng/packages
by Tomas Lestach
java/spacewalk-java.spec | 11 ++++++++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 11 insertions(+), 2 deletions(-)
New commits:
commit a311a5f208e924f56f20a095cf6d6a233574d8f2
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jun 28 18:22:49 2011 +0200
Automatic commit of package [spacewalk-java] release [1.5.51-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index e06dee3..c88f59c 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -17,7 +17,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.5.50
+Version: 1.5.51
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -546,6 +546,15 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Tue Jun 28 2011 Tomas Lestach <tlestach(a)redhat.com> 1.5.51-1
+- fix never ending loop, when entering an invalid storage value
+ (tlestach(a)redhat.com)
+- rename localStorageMegabytes -> localStorageGigabytes (tlestach(a)redhat.com)
+- storage isn't set in MB, but in GB (ug(a)suse.de)
+- prevent setting virtual bridge to null (ug(a)suse.de)
+- 699505 - introduce channel.software.setUserManagable and
+ channel.software.isUserManagable API calls (tlestach(a)redhat.com)
+
* Mon Jun 27 2011 Tomas Lestach <tlestach(a)redhat.com> 1.5.50-1
- 710433 - fix kickstart via proxy from RHEL6 Satellite (tlestach(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 21fd96f..b268fbd 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.5.50-1 java/
+1.5.51-1 java/
11 years, 11 months
4 commits - java/code
by Tomas Lestach
java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java | 19 +++++-----
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 2 -
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 14 +++----
java/code/src/com/redhat/rhn/manager/action/ActionManager.java | 8 +++-
java/code/src/com/redhat/rhn/manager/kickstart/ProvisionVirtualInstanceCommand.java | 2 -
java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/ks-wizard.jspf | 4 +-
java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/virt-options.jspf | 2 -
java/code/webapp/WEB-INF/struts-config.xml | 2 -
8 files changed, 30 insertions(+), 23 deletions(-)
New commits:
commit 66fe68b343f627399df15cdbc99e166567634d8e
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jun 28 17:47:41 2011 +0200
fix never ending loop, when entering an invalid storage value
diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java b/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java
index 05b8dc3..b8ffb4e 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java
@@ -272,6 +272,7 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
catch (NumberFormatException e) {
errors.add(ActionErrors.GLOBAL_MESSAGE, new ActionMessage(
"frontend.actions.systems.virt.invalidstoragevalue"));
+ form.set(LOCAL_STORAGE_GB, "");
}
}
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 ce19863..77fbcdd 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
@@ -8297,7 +8297,7 @@ Follow this url to see the full list of inactive systems:
</trans-unit>
<trans-unit id="frontend.actions.systems.virt.invalidstoragevalue">
- <source>Storage must be set to a value greater than 0.</source>
+ <source>Only natural numbers are accepted as storage values.</source>
</trans-unit>
<trans-unit id="frontend.actions.channels.manager.add.viewChannels">
commit 76571424e3edcc5bb862d52ef69fd33c4deb9c4e
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jun 28 17:14:50 2011 +0200
rename localStorageMegabytes -> localStorageGigabytes
diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java b/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java
index 0d552c8..05b8dc3 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java
@@ -51,7 +51,7 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
public static final String VIRTUAL_CPUS = "virtualCpus";
public static final String VIRTUAL_BRIDGE = "virtBridge";
public static final String VIRTUAL_FILE_PATH = "diskPath";
- public static final String LOCAL_STORAGE_MB = "localStorageMegabytes";
+ public static final String LOCAL_STORAGE_GB = "localStorageGigabytes";
public static final String PROFILE = "cobbler_profile";
public static final String GUEST_NAME = "guestName";
@@ -74,8 +74,8 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
form.set(VIRTUAL_CPUS, "");
}
- if (StringUtils.isEmpty(form.getString(LOCAL_STORAGE_MB))) {
- form.set(LOCAL_STORAGE_MB, "");
+ if (StringUtils.isEmpty(form.getString(LOCAL_STORAGE_GB))) {
+ form.set(LOCAL_STORAGE_GB, "");
}
return super.runFirst(mapping, form, ctx, response, step);
@@ -114,8 +114,8 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
form.set(VIRTUAL_CPUS, String.valueOf(pf.getVirtCpus()));
}
- if (StringUtils.isEmpty(form.getString(LOCAL_STORAGE_MB))) {
- form.set(LOCAL_STORAGE_MB, String.valueOf(pf.getVirtFileSize()));
+ if (StringUtils.isEmpty(form.getString(LOCAL_STORAGE_GB))) {
+ form.set(LOCAL_STORAGE_GB, String.valueOf(pf.getVirtFileSize()));
}
if (StringUtils.isEmpty(form.getString(VIRTUAL_BRIDGE))) {
@@ -184,8 +184,8 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
cmd.setVirtualCpus(new Long(this.getCobblerProfile(ctx).getVirtCpus()));
}
- if (!StringUtils.isEmpty(form.getString(LOCAL_STORAGE_MB))) {
- cmd.setLocalStorageSize(new Long(form.getString(LOCAL_STORAGE_MB)));
+ if (!StringUtils.isEmpty(form.getString(LOCAL_STORAGE_GB))) {
+ cmd.setLocalStorageSize(new Long(form.getString(LOCAL_STORAGE_GB)));
}
else {
cmd.setLocalStorageSize(new Long(
@@ -262,9 +262,9 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
}
}
- if (!StringUtils.isEmpty(form.getString(LOCAL_STORAGE_MB))) {
+ if (!StringUtils.isEmpty(form.getString(LOCAL_STORAGE_GB))) {
try {
- Long storage = Long.parseLong(form.getString(LOCAL_STORAGE_MB));
+ Long storage = Long.parseLong(form.getString(LOCAL_STORAGE_GB));
if (storage <= 0) {
throw new NumberFormatException();
}
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
index 0b4d2d6..541a4eb 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
@@ -2217,7 +2217,7 @@ public class SystemHandler extends BaseHandler {
* @param profileName of Kickstart Profile to use.
* @param memoryMb to allocate to the guest (maxMemory)
* @param vcpus to assign
- * @param storageMb to assign to disk
+ * @param storageGb to assign to disk
* @return Returns 1 if successful, exception otherwise
*
* @xmlrpc.doc Provision a guest on the host specified. This schedules the guest
@@ -2231,11 +2231,11 @@ public class SystemHandler extends BaseHandler {
* @xmlrpc.param #param_desc("int", "memoryMb", "Memory to allocate to the guest")
* @xmlrpc.param #param_desc("int", "vcpus", "Number of virtual CPUs to allocate to
* the guest.")
- * @xmlrpc.param #param_desc("int", "storageMb", "Size of the guests disk image.")
+ * @xmlrpc.param #param_desc("int", "storageGb", "Size of the guests disk image.")
* @xmlrpc.returntype #return_int_success()
*/
public int provisionVirtualGuest(String sessionKey, Integer sid, String guestName,
- String profileName, Integer memoryMb, Integer vcpus, Integer storageMb) {
+ String profileName, Integer memoryMb, Integer vcpus, Integer storageGb) {
log.debug("provisionVirtualGuest called.");
User loggedInUser = getLoggedInUser(sessionKey);
// Lookup the server so we can validate it exists and throw error if not.
@@ -2279,7 +2279,7 @@ public class SystemHandler extends BaseHandler {
cmd.setGuestName(guestName);
cmd.setMemoryAllocation(new Long(memoryMb));
cmd.setVirtualCpus(new Long(vcpus.toString()));
- cmd.setLocalStorageSize(new Long(storageMb));
+ cmd.setLocalStorageSize(new Long(storageGb));
// setting an empty string generates a default virt path
cmd.setFilePath("");
// Store the new KickstartSession to the DB.
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/ProvisionVirtualInstanceCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/ProvisionVirtualInstanceCommand.java
index af95f4e..9fddb88 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/ProvisionVirtualInstanceCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/ProvisionVirtualInstanceCommand.java
@@ -254,7 +254,7 @@ public class ProvisionVirtualInstanceCommand extends KickstartScheduleCommand {
}
/**
- * @return Returns the localStorageMb
+ * @return Returns the localStorage in GB
*/
public Long getLocalStorageSize() {
return localStorage;
diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/ks-wizard.jspf b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/ks-wizard.jspf
index 364c576..e554ad7 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/ks-wizard.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/ks-wizard.jspf
@@ -23,7 +23,7 @@
<!-- Store guest provisioning info -->
<input type="hidden" name="memoryAllocation" value="${form.memoryAllocation}" />
<input type="hidden" name="virtualCpus" value="${form.virtualCpus}" />
- <input type="hidden" name="localStorageMegabytes" value="${form.localStorageMegabytes}" />
+ <input type="hidden" name="localStorageGigabytes" value="${form.localStorageGigabytes}" />
<input type="hidden" name="diskPath" value="${form.diskPath}" />
</c:if>
<%@ include file="/WEB-INF/pages/common/fragments/kickstart/schedule/proxy-options.jspf" %>
@@ -43,4 +43,4 @@
</td>
</tr>
</table>
- </c:if>
\ No newline at end of file
+ </c:if>
diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/virt-options.jspf b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/virt-options.jspf
index 2341873..dc8df8e 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/virt-options.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/virt-options.jspf
@@ -27,7 +27,7 @@
<th><bean:message key="virtualization.provision.first.jsp.storage"/></th>
<td>
<bean:message key="virtualization.provision.first.jsp.storage.local.message1"/>
- <html:text styleId="localStorageMegabytesId" property="localStorageMegabytes"
+ <html:text styleId="localStorageGigabytesId" property="localStorageGigabytes"
maxlength="20" size="6"/>
<bean:message key="virtualization.provision.first.jsp.storage.local.gigabytes"/>
</td>
diff --git a/java/code/webapp/WEB-INF/struts-config.xml b/java/code/webapp/WEB-INF/struts-config.xml
index 021f6f7..ee6f3ac 100644
--- a/java/code/webapp/WEB-INF/struts-config.xml
+++ b/java/code/webapp/WEB-INF/struts-config.xml
@@ -814,7 +814,7 @@
<form-property name="virtBridge" type="java.lang.String" />
<form-property name="diskPath" type="java.lang.String" />
<form-property name="storageType" type="java.lang.String" />
- <form-property name="localStorageMegabytes" type="java.lang.String" />
+ <form-property name="localStorageGigabytes" type="java.lang.String" />
<form-property name="guestName" type="java.lang.String" />
commit 2a66c63b49c80d545b66a6c6763c1784a4fb2640
Author: Uwe Gansert <ug(a)suse.de>
Date: Tue Jun 28 18:20:12 2011 +0200
storage isn't set in MB, but in GB
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
index 0bedfc6..0b4d2d6 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
@@ -2079,7 +2079,7 @@ public class SystemHandler extends BaseHandler {
/**
*
* Provision a guest on the server specified. Defaults to: memory=256MB, vcpu=1,
- * storage=2048MB.
+ * storage=2GB.
*
* @param sessionKey of user making call
* @param sid of server to provision guest on
@@ -2088,7 +2088,7 @@ public class SystemHandler extends BaseHandler {
* @return Returns 1 if successful, exception otherwise
*
* @xmlrpc.doc Provision a guest on the host specified. Defaults to:
- * memory=256MB, vcpu=1, storage=2048MB.
+ * memory=256MB, vcpu=1, storage=2GB.
* @xmlrpc.param #param("string", "sessionKey")
* @xmlrpc.param #param("int", "serverId") - ID of host to provision guest on.
* @xmlrpc.param #param("string", "guestName")
@@ -2098,7 +2098,7 @@ public class SystemHandler extends BaseHandler {
public int provisionVirtualGuest(String sessionKey, Integer sid, String guestName,
String profileName) {
return provisionVirtualGuest(sessionKey, sid, guestName, profileName,
- new Integer(256), new Integer(1), new Integer(2048));
+ new Integer(256), new Integer(1), new Integer(2));
}
/**
commit 619818bacae4d5e988d2959ffce76feed1562a31
Author: Uwe Gansert <ug(a)suse.de>
Date: Tue Jun 28 18:19:06 2011 +0200
prevent setting virtual bridge to null
diff --git a/java/code/src/com/redhat/rhn/manager/action/ActionManager.java b/java/code/src/com/redhat/rhn/manager/action/ActionManager.java
index 2f737e1..a003a81 100644
--- a/java/code/src/com/redhat/rhn/manager/action/ActionManager.java
+++ b/java/code/src/com/redhat/rhn/manager/action/ActionManager.java
@@ -1528,7 +1528,6 @@ public class ActionManager extends BaseManager {
kad.setDiskGb(pcmd.getLocalStorageSize());
kad.setMemMb(pcmd.getMemoryAllocation().longValue());
- kad.setVirtBridge(pcmd.getVirtBridge());
kad.setDiskPath(pcmd.getFilePath());
kad.setVcpus(new Long(pcmd.getVirtualCpus()));
kad.setGuestName(pcmd.getGuestName());
@@ -1536,6 +1535,13 @@ public class ActionManager extends BaseManager {
Profile cProfile = Profile.lookupById(CobblerXMLRPCHelper.getConnection(
pcmd.getUser()), pcmd.getKsdata().getCobblerId());
+ if (pcmd.getVirtBridge() == null) {
+ kad.setVirtBridge(cProfile.getVirtBridge());
+ }
+ else {
+ kad.setVirtBridge(pcmd.getVirtBridge());
+ }
+
CobblerVirtualSystemCommand vcmd = new CobblerVirtualSystemCommand(
pcmd.getServer(), cProfile.getName(), pcmd.getGuestName(),
pcmd.getKsdata());
11 years, 11 months
java/code
by Tomas Lestach
java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java | 82 ++++++++++
java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java | 70 ++++++++
2 files changed, 152 insertions(+)
New commits:
commit 2f15fa6f0d6d1be52fb7f3acfe024480c2c5ac62
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Jun 23 17:46:54 2011 +0200
699505 - introduce channel.software.setUserManagable and channel.software.isUserManagable API calls
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
index 9e4f2d5..35a3ba9 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
@@ -1013,6 +1013,54 @@ public class ChannelSoftwareHandler extends BaseHandler {
}
/**
+ * Set the managable flag for a given channel and user. If value is set to 'true',
+ * this method will give the user manage permissions to the channel. Otherwise, this
+ * method revokes that privilege.
+ * @param sessionKey The sessionKey containing the logged in user
+ * @param channelLabel The label for the channel in question
+ * @param login The login for the user in question
+ * @param value The boolean value telling us whether to grant manage permission or
+ * revoke it.
+ * @return Returns 1 on success, FaultException otherwise
+ * @throws FaultException A FaultException is thrown if:
+ * - The loggedInUser doesn't have permission to perform this action
+ * - The login, sessionKey, or channelLabel is invalid
+ *
+ * @xmlrpc.doc Set the managable flag for a given channel and user.
+ * If value is set to 'true', this method will give the user
+ * manage permissions to the channel. Otherwise, that privilege is revoked.
+ * @xmlrpc.param #session_key()
+ * @xmlrpc.param #param_desc("string", "channelLabel", "label of the channel")
+ * @xmlrpc.param #param_desc("string", "login", "login of the target user")
+ * @xmlrpc.param #param_desc("boolean", "value", "value of the flag to set")
+ * @xmlrpc.returntype #return_int_success()
+ */
+ public int setUserManagable(String sessionKey, String channelLabel,
+ String login, Boolean value) throws FaultException {
+ // Get Logged in user
+ User loggedInUser = getLoggedInUser(sessionKey);
+ User target = XmlRpcUserHelper.getInstance().lookupTargetUser(loggedInUser, login);
+
+ Channel channel = lookupChannelByLabel(loggedInUser, channelLabel);
+ //Verify permissions
+ if (!(UserManager.verifyChannelAdmin(loggedInUser, channel) ||
+ loggedInUser.hasRole(RoleFactory.CHANNEL_ADMIN))) {
+ throw new PermissionCheckFailureException();
+ }
+
+ if (value) {
+ // Add the 'manage' role for the target user to the channel
+ ChannelManager.addManageRole(target, channel);
+ }
+ else {
+ // Remove the 'manage' role for the target user to the channel
+ ChannelManager.removeManageRole(target, channel);
+ }
+
+ return 1;
+ }
+
+ /**
* Returns whether the channel may be subscribed to by the given user.
* @param sessionKey The sessionKey containing the logged in user
* @param channelLabel The label for the channel in question
@@ -1047,6 +1095,40 @@ public class ChannelSoftwareHandler extends BaseHandler {
}
/**
+ * Returns whether the channel may be managed by the given user.
+ * @param sessionKey The sessionKey containing the logged in user
+ * @param channelLabel The label for the channel in question
+ * @param login The login for the user in question
+ * @return whether the channel may be managed by the given user.
+ * @throws FaultException thrown if
+ * - The loggedInUser doesn't have permission to perform this action
+ * - The login, sessionKey, or channelLabel is invalid
+ *
+ * @xmlrpc.doc Returns whether the channel may be managed by the given user.
+ * @xmlrpc.param #session_key()
+ * @xmlrpc.param #param_desc("string", "channelLabel", "label of the channel")
+ * @xmlrpc.param #param_desc("string", "login", "login of the target user")
+ * @xmlrpc.returntype int - 1 if subscribable, 0 if not
+ */
+ public int isUserManagable(String sessionKey, String channelLabel,
+ String login) throws FaultException {
+ // Get Logged in user
+ User loggedInUser = getLoggedInUser(sessionKey);
+ User target = XmlRpcUserHelper.getInstance().lookupTargetUser(
+ loggedInUser, login);
+
+ Channel channel = lookupChannelByLabel(loggedInUser.getOrg(), channelLabel);
+ //Verify permissions
+ if (!(UserManager.verifyChannelAdmin(loggedInUser, channel) ||
+ loggedInUser.hasRole(RoleFactory.CHANNEL_ADMIN))) {
+ throw new PermissionCheckFailureException();
+ }
+
+ boolean flag = ChannelManager.verifyChannelManage(target, channel.getId());
+ return BooleanUtils.toInteger(flag);
+ }
+
+ /**
* Set globally subscribable attribute for given channel.
* @param sessionKey The sessionKey containing the logged in user
* @param channelLabel The label for the channel to change
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 f650fbc..9e045b9 100644
--- a/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
+++ b/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
@@ -982,6 +982,44 @@ public class ChannelManager extends BaseManager {
}
/**
+ * Adds the mange role for the passed in user for the passed in channel.
+ * @param user The user in question.
+ * @param channel The channel in question.
+ */
+ public static void addManageRole(User user, Channel channel) {
+ if (verifyChannelManage(user, channel.getId())) {
+ return; //user already has subscribe perms to this channel
+ }
+ //Insert row into rhnChannelPermission
+ WriteMode m = ModeFactory.getWriteMode("Channel_queries",
+ "grant_channel_permission");
+ Map params = new HashMap();
+ params.put("user_id", user.getId());
+ params.put("cid", channel.getId());
+ params.put("role_label", QRY_ROLE_MANAGE);
+ m.executeUpdate(params);
+ }
+
+ /**
+ * Removes the manage role from the passed in user for the passed in channel.
+ * @param user The user in question.
+ * @param channel The channel in question.
+ */
+ public static void removeManageRole(User user, Channel channel) {
+ if (!verifyChannelManage(user, channel.getId())) {
+ return; //user doesn't have subscribe perms to begin with
+ }
+ //Delete row from rhnChannelPermission
+ WriteMode m = ModeFactory.getWriteMode("Channel_queries",
+ "revoke_channel_permission");
+ Map params = new HashMap();
+ params.put("user_id", user.getId());
+ params.put("cid", channel.getId());
+ params.put("role_label", QRY_ROLE_MANAGE);
+ m.executeUpdate(params);
+ }
+
+ /**
* Makes sure the passed in user has subscribe permissions to the channel with the
* given id.
* @param user The user in question
@@ -1014,6 +1052,38 @@ public class ChannelManager extends BaseManager {
}
/**
+ * Makes sure the passed in user has manage permissions to the channel with the
+ * given id.
+ * @param user The user in question
+ * @param cid The id for the channel in question
+ * @return Returns true if the user has permission, false otherwise
+ */
+ public static boolean verifyChannelManage(User user, Long cid) {
+
+ if (user.hasRole(RoleFactory.RHN_SUPERUSER)) {
+ return true;
+ }
+
+ try {
+ return verifyChannelRole(user, cid, QRY_ROLE_MANAGE);
+ }
+ catch (InvalidChannelRoleException e) {
+ /*
+ * We don't really care what the reason is for why this user doesn't have
+ * access to this channel, so catch the exception, log it, and simply
+ * return false.
+ */
+ StringBuffer msg = new StringBuffer("User: ");
+ msg.append(user.getLogin());
+ msg.append(" either does not have subscribe privileges to Channel: ");
+ msg.append(cid);
+ msg.append(" or ChannelManager.QRY_ROLE_MANAGE is defined wrong.");
+ log.debug(msg.toString(), e);
+ return false;
+ }
+ }
+
+ /**
* Check to see if the channel passed in is subscribable by the Server passed in for
* *free* without costing an entitlement. Criteria:
*
11 years, 11 months
Changes to 'refs/tags/yum-rhn-plugin-1.5.7-1'
by Miroslav Suchý
Tag 'yum-rhn-plugin-1.5.7-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2011-06-28 09:55 +0000
Tagging package [yum-rhn-plugin] version [1.5.7-1] in directory [client/rhel/yum-rhn-plugin/].
Changes since spacewalk-java-1.5.50-1:
Miroslav Suchý (2):
707241 - create progressbar even during groupinstall and do not delete rhnplugin.repos during groupinstall command
Automatic commit of package [yum-rhn-plugin] release [1.5.7-1].
---
client/rhel/yum-rhn-plugin/rhnplugin.py | 40 ++++++++++++++++---------
client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec | 6 +++
rel-eng/packages/yum-rhn-plugin | 2 -
3 files changed, 33 insertions(+), 15 deletions(-)
---
11 years, 11 months
2 commits - client/rhel rel-eng/packages
by Miroslav Suchý
client/rhel/yum-rhn-plugin/rhnplugin.py | 40 ++++++++++++++++---------
client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec | 6 +++
rel-eng/packages/yum-rhn-plugin | 2 -
3 files changed, 33 insertions(+), 15 deletions(-)
New commits:
commit 9845810362cc698d10307bd4c648bcc187241c91
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Jun 28 11:55:18 2011 +0200
Automatic commit of package [yum-rhn-plugin] release [1.5.7-1].
diff --git a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
index a799606..953cc57 100644
--- a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
+++ b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
@@ -1,6 +1,6 @@
Summary: RHN support for yum
Name: yum-rhn-plugin
-Version: 1.5.6
+Version: 1.5.7
Release: 1%{?dist}
License: GPLv2
Group: System Environment/Base
@@ -72,6 +72,10 @@ fi
%doc LICENSE
%changelog
+* Tue Jun 28 2011 Miroslav Suchý 1.5.7-1
+- 707241 - create progressbar even during groupinstall and do not delete
+ rhnplugin.repos during groupinstall command (msuchy(a)redhat.com)
+
* Mon May 02 2011 Miroslav Suchý 1.5.6-1
- set proxy_dict only if we have some proxy
- proxy_dict is private attribute
diff --git a/rel-eng/packages/yum-rhn-plugin b/rel-eng/packages/yum-rhn-plugin
index 5d65323..39f4c01 100644
--- a/rel-eng/packages/yum-rhn-plugin
+++ b/rel-eng/packages/yum-rhn-plugin
@@ -1 +1 @@
-1.5.6-1 client/rhel/yum-rhn-plugin/
+1.5.7-1 client/rhel/yum-rhn-plugin/
commit 83fc936f50812b72e40c3cd64b866bd462a5d53f
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Jun 28 11:53:18 2011 +0200
707241 - create progressbar even during groupinstall and do not delete rhnplugin.repos during groupinstall command
during groupinstall is prereposetup_hook called twice (BZ#717163) and
during second run rhnplugin.repos is efectively truncated
and if rhnplugin.repos does not exist (first run, or next after groupinstall)
repos is not populated in init() and there is no progress bar callback to copy from.
We have to create it, which is really big hack - that part of code has been copied
from yum module output, function setupProgressCallbacks()
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py b/client/rhel/yum-rhn-plugin/rhnplugin.py
index f7c99b6..8660cf5 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -26,6 +26,9 @@ import gettext
t = gettext.translation('yum-rhn-plugin', fallback=True)
_ = t.ugettext
+sys.path.append('/usr/share/yum-cli')
+from output import YumTextMeter, CacheProgressCallback
+
# TODO: Get the up2date stuff that we need in a better place,
# so we don't have to do path magic.
sys.path.append("/usr/share/rhn/")
@@ -151,18 +154,17 @@ def prereposetup_hook(conduit):
return
repos = conduit.getRepos()
- cachedir = conduit.getConf().cachedir
- default_gpgcheck = conduit.getConf().gpgcheck
+ conduit_conf = conduit.getConf()
+ cachedir = conduit_conf.cachedir
+ default_gpgcheck = conduit_conf.gpgcheck
gpgcheck = conduit.confBool('main', 'gpgcheck', default_gpgcheck)
sslcacert = get_ssl_ca_cert(up2date_cfg)
- enablegroups = conduit.getConf().enablegroups
- metadata_expire = conduit.getConf().metadata_expire
+ enablegroups = conduit_conf.enablegroups
+ metadata_expire = conduit_conf.metadata_expire
cachefilename = os.path.join(cachedir, cachedRHNReposFile)
- try:
- cachefile = open(cachefilename, 'w')
- except:
- cachefile = None
+ cachefile_content = ''
+ create_cache_even_second_time = not (os.path.exists(cachefilename) and os.path.getsize(cachefilename))
for channel in svrChannels:
if channel['version']:
repo = RhnRepo(channel)
@@ -171,11 +173,18 @@ def prereposetup_hook(conduit):
# there will be nearly always only one, and even if there is more
# repos, we can ignore them
if type(already_exists_repos[0]) == type(repo): # repo is type of RhnRepo
- continue # repo has been already initialized
+ # repo has been already initialized
+ if create_cache_even_second_time:
+ cachefile_content += already_exists_repos.id + "\n"
+ continue
else: # YumRepository from _init, made for caching
callback = already_exists_repos[0].callback
repo.setCallback(callback)
repos.delete(repo.id)
+ else: # no repo created in init - setup progressbar
+ if (not (conduit_conf.debuglevel < 2 or not sys.stdout.isatty())):
+ progressbar = YumTextMeter(fo=sys.stdout)
+ repo.setCallback(progressbar)
repo.basecachedir = cachedir
repo.gpgcheck = gpgcheck
repo.proxy = proxy_url
@@ -192,10 +201,15 @@ def prereposetup_hook(conduit):
conduit.info(5, "Repo '%s' setting option '%s' = '%s'" %
(repo.id, o[0], o[1]))
repos.add(repo)
- if cachefile:
- cachefile.write("%s %s\n" % (repo.id, repo.name))
- if cachefile:
- cachefile.close()
+ cachefile_content += "%s %s\n" % (repo.id, repo.name)
+ if cachefile_content:
+ try:
+ cachefile = open(cachefilename, 'w')
+ except IOError:
+ cachefile = None # this is not fatal, we can live without cache
+ if cachefile:
+ cachefile.write(cachefile_content)
+ cachefile.close()
# resolve --enablerepo/--disablerepo for RHN repos
opts = conduit.getCmdLine()[0]
11 years, 11 months
Changes to 'refs/tags/spacewalk-java-1.5.50-1'
by Tomas Lestach
Tag 'spacewalk-java-1.5.50-1' created by Tomas Lestach <tlestach(a)redhat.com> at 2011-06-27 14:59 +0000
Tagging package [spacewalk-java] version [1.5.50-1] in directory [java/].
Changes since spacewalk-remote-utils-1.5.2-1:
Tomas Lestach (2):
710433 - fix kickstart via proxy from RHEL6 Satellite
Automatic commit of package [spacewalk-java] release [1.5.50-1].
---
java/code/src/com/redhat/rhn/frontend/action/common/DownloadFile.java | 44 ++++++----
java/spacewalk-java.spec | 5 -
rel-eng/packages/spacewalk-java | 2
3 files changed, 33 insertions(+), 18 deletions(-)
---
11 years, 11 months
java/spacewalk-java.spec rel-eng/packages
by Tomas Lestach
java/spacewalk-java.spec | 5 ++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 520e025e6c0b2b13acbe3644c09d3f0e2d6e55d4
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Mon Jun 27 16:59:58 2011 +0200
Automatic commit of package [spacewalk-java] release [1.5.50-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index efe8fce..e06dee3 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -17,7 +17,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.5.49
+Version: 1.5.50
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -546,6 +546,9 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Mon Jun 27 2011 Tomas Lestach <tlestach(a)redhat.com> 1.5.50-1
+- 710433 - fix kickstart via proxy from RHEL6 Satellite (tlestach(a)redhat.com)
+
* Fri Jun 24 2011 Jan Pazdziora 1.5.49-1
- 699523 - extend user.GetDetails by PAM usage info (tlestach(a)redhat.com)
- let finish the kickstart profile creation by the Enter button
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 21ae04b..21fd96f 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.5.49-1 java/
+1.5.50-1 java/
11 years, 11 months