backend/satellite_tools
by Justin Sherrill
backend/satellite_tools/reposync.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
New commits:
commit 24c19218334a1cd858994bb62bd8759f3cab5537
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Sep 15 11:54:52 2010 -0400
629986 - updating channels last synced time from spacewalk-repo-sync commandline
diff --git a/backend/satellite_tools/reposync.py b/backend/satellite_tools/reposync.py
index df24f12..c2ac6e7 100644
--- a/backend/satellite_tools/reposync.py
+++ b/backend/satellite_tools/reposync.py
@@ -104,9 +104,17 @@ class RepoSync:
if self.regen:
taskomatic.add_to_repodata_queue_for_channel_package_subscription(
[self.channel_label], [], "server.app.yumreposync")
- rhnSQL.commit()
+ self.update_date()
+ rhnSQL.commit()
self.print_msg("Sync complete")
+
+ def update_date(self):
+ """ Updates the last sync time"""
+ h = rhnSQL.prepare( """update rhnChannel set LAST_SYNCED = sysdate
+ where label = :channel""")
+ h.execute(channel=self.channel['label'])
+
def process_args(self):
self.parser = OptionParser()
self.parser.add_option('-u', '--url', action='store', dest='url', help='The url to sync')
13 years, 8 months
3 commits - java/code web/conf
by Justin Sherrill
java/code/src/com/redhat/rhn/domain/kickstart/RepoInfo.java | 18 ++-
java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartSoftwareEditAction.java | 7 -
java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java | 47 ++++++++++
java/code/src/com/redhat/rhn/manager/configuration/ConfigurationManager.java | 4
java/code/src/com/redhat/rhn/manager/kickstart/KickstartEditCommand.java | 3
java/code/src/com/redhat/rhn/manager/kickstart/KickstartWizardHelper.java | 2
web/conf/rhn_web.conf | 2
7 files changed, 70 insertions(+), 13 deletions(-)
New commits:
commit 82df3bd694abd4a2f4e763df611682ffd29d74f0
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Sep 15 11:19:45 2010 -0400
checkstyle fix
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java
index 7669d58..9d7d8d6 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java
@@ -392,6 +392,7 @@ public class ConfigChannelHandler extends BaseHandler {
* @param sessionKey the session key
* @param channelLabel the channel label
* @param path path to examine.
+ * @param revision the revision to fetch
* @return the specified config revision of the requested path.
* @since 10.12
*
diff --git a/java/code/src/com/redhat/rhn/manager/configuration/ConfigurationManager.java b/java/code/src/com/redhat/rhn/manager/configuration/ConfigurationManager.java
index 9fd4007..7e3e2b8 100644
--- a/java/code/src/com/redhat/rhn/manager/configuration/ConfigurationManager.java
+++ b/java/code/src/com/redhat/rhn/manager/configuration/ConfigurationManager.java
@@ -1120,7 +1120,8 @@ public class ConfigurationManager extends BaseManager {
* @param pc controller/elaborator for the list
* @return List of revisions in dto format.
*/
- public DataResult<ConfigRevisionDto> listRevisionsForFile(User user, ConfigFile file, PageControl pc) {
+ public DataResult<ConfigRevisionDto> listRevisionsForFile(User user,
+ ConfigFile file, PageControl pc) {
Map params = new HashMap();
params.put("cfid", file.getId());
params.put("user_id", user.getId());
commit 22954384d46900f7506eeaf16bd5d50b6e8e88a6
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Sep 15 11:17:07 2010 -0400
633535 - added RHEL 5 subrepos as well as stopped showing repos not valid for a particular release
diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/RepoInfo.java b/java/code/src/com/redhat/rhn/domain/kickstart/RepoInfo.java
index 1d71b77..1340930 100644
--- a/java/code/src/com/redhat/rhn/domain/kickstart/RepoInfo.java
+++ b/java/code/src/com/redhat/rhn/domain/kickstart/RepoInfo.java
@@ -15,11 +15,13 @@
package com.redhat.rhn.domain.kickstart;
+import com.redhat.rhn.common.util.StringUtil;
import com.redhat.rhn.manager.kickstart.KickstartUrlHelper;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
+import java.io.File;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.regex.Matcher;
@@ -126,14 +128,20 @@ public class RepoInfo {
/**
* Returns all the 4 standard repos available to rhel 5
* cluster, clusterstorage, workstation and VT
+ * @param tree the kickstartable tree
* @return the standard repos..
*/
- public static Map<String, RepoInfo> getStandardRepos() {
+ public static Map<String, RepoInfo> getStandardRepos(KickstartableTree tree) {
Map <String, RepoInfo> map = new LinkedHashMap<String, RepoInfo>();
- addToMap(map, "Cluster");
- addToMap(map, "ClusterStorage");
- addToMap(map, "Workstation");
- addToMap(map, "VT");
+ String[] repos = {"Cluster", "ClusterStorage", "HighAvailability",
+ "LoadBalancer", "ResilientStorage", "VT", "Workstation"};
+
+ for (String repo : repos) {
+ File file = new File(StringUtil.addPath(tree.getAbsolutePath(), repo));
+ if (file.exists()) {
+ addToMap(map, repo);
+ }
+ }
return map;
}
diff --git a/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartSoftwareEditAction.java b/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartSoftwareEditAction.java
index 41c29da..43686dc 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartSoftwareEditAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartSoftwareEditAction.java
@@ -223,7 +223,7 @@ public class KickstartSoftwareEditAction extends BaseKickstartEditAction {
ValidatorError ve = cmd.updateKickstartableTree(
(Long) form.get(CHANNEL), cmdIn.getUser().getOrg().getId(),
(Long) form.get(TREE),
- (String) form.getString(URL));
+ form.getString(URL));
if (ve == null) {
String [] repos = form.getStrings(SELECTED_REPOS);
@@ -254,11 +254,10 @@ public class KickstartSoftwareEditAction extends BaseKickstartEditAction {
!tree.getInstallType().isRhel3() &&
!tree.getInstallType().isRhel4()) {
List <LabelValueEnabledBean> repos = new LinkedList<LabelValueEnabledBean>();
- for (String name : RepoInfo.getStandardRepos().keySet()) {
+ for (String name : RepoInfo.getStandardRepos(tree).keySet()) {
repos.add(lve(name, name, false));
}
- form.set(POSSIBLE_REPOS, (LabelValueEnabledBean[])
- repos.toArray(new LabelValueEnabledBean[0]));
+ form.set(POSSIBLE_REPOS, repos.toArray(new LabelValueEnabledBean[0]));
Set<RepoInfo> selected = ksdata.getRepoInfos();
String [] items = new String[selected.size()];
int i = 0;
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartEditCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartEditCommand.java
index 1bcbca2..e24b025 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartEditCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartEditCommand.java
@@ -374,7 +374,8 @@ public class KickstartEditCommand extends BaseKickstartCommand {
public void updateRepos(String[] reposIn) {
if (ksdata.isRhel5OrGreater()) {
- Map<String, RepoInfo> repos = RepoInfo.getStandardRepos();
+ Map<String, RepoInfo> repos = RepoInfo.getStandardRepos(
+ ksdata.getKickstartDefaults().getKstree());
Set<RepoInfo> selected = new HashSet <RepoInfo>();
for (int i = 0; i < reposIn.length; i++) {
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartWizardHelper.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartWizardHelper.java
index b5d39a3..5d404dd 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartWizardHelper.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartWizardHelper.java
@@ -199,7 +199,7 @@ public class KickstartWizardHelper {
* @param ksdata the data to which the repos have to be processed
*/
public void processRepos(KickstartData ksdata) {
- if (ksdata.isRhel5OrGreater()) {
+ if (ksdata.isRhel5()) {
Set<RepoInfo> repos = ksdata.getRepoInfos();
RepoInfo vt = RepoInfo.vt();
if (!repos.contains(vt)) {
commit cdf80b5ce03fb99c33917b49b702828db3d2d906
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Sep 15 10:21:08 2010 -0400
adding configchannel.lookupFileInfo() taking a revision id
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java
index 0e6bcb0..7669d58 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java
@@ -24,12 +24,15 @@ import com.redhat.rhn.domain.config.ConfigChannelType;
import com.redhat.rhn.domain.config.ConfigFile;
import com.redhat.rhn.domain.config.ConfigFileType;
import com.redhat.rhn.domain.config.ConfigRevision;
+import com.redhat.rhn.domain.config.ConfigurationFactory;
import com.redhat.rhn.domain.server.Server;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.frontend.dto.ConfigChannelDto;
import com.redhat.rhn.frontend.dto.ConfigFileDto;
+import com.redhat.rhn.frontend.dto.ConfigRevisionDto;
import com.redhat.rhn.frontend.dto.ConfigSystemDto;
import com.redhat.rhn.frontend.xmlrpc.BaseHandler;
+import com.redhat.rhn.frontend.xmlrpc.NoSuchConfigRevisionException;
import com.redhat.rhn.frontend.xmlrpc.serializer.ConfigRevisionSerializer;
import com.redhat.rhn.manager.MissingCapabilityException;
import com.redhat.rhn.manager.action.ActionManager;
@@ -383,6 +386,49 @@ public class ConfigChannelHandler extends BaseHandler {
return revisions;
}
+
+ /**
+ * Given a path and revision number, return the revision
+ * @param sessionKey the session key
+ * @param channelLabel the channel label
+ * @param path path to examine.
+ * @return the specified config revision of the requested path.
+ * @since 10.12
+ *
+ * @xmlrpc.doc Given a path, revision number, and a channel, returns details about
+ * the latest revisions of the paths.
+ * @xmlrpc.param #session_key()
+ * @xmlrpc.param #param_desc("string", "channelLabel",
+ * "label of config channel to lookup on")
+ * @xmlrpc.param #param_desc("string", "path",
+ * "path of file/directory")
+ * @xmlrpc.param #param_desc("int", "revsion",
+ * "The revision number.")
+ *
+ * @xmlrpc.returntype
+ * $ConfigRevisionSerializer
+ */
+ public ConfigRevision lookupFileInfo(String sessionKey,
+ String channelLabel,
+ String path,
+ Integer revision
+ ) {
+ User loggedInUser = getLoggedInUser(sessionKey);
+ XmlRpcConfigChannelHelper configHelper = XmlRpcConfigChannelHelper.getInstance();
+ ConfigChannel channel = configHelper.lookupGlobal(loggedInUser,
+ channelLabel);
+ ConfigurationManager cm = ConfigurationManager.getInstance();
+ ConfigFile cf = cm.lookupConfigFile(loggedInUser, channel.getId(), path);
+ List<ConfigRevisionDto> revs = cm.listRevisionsForFile(loggedInUser, cf, null);
+ for (ConfigRevisionDto rev : revs) {
+ if (rev.getRevisionNumber().equals(revision)) {
+ return ConfigurationFactory.lookupConfigRevisionById(rev.getId());
+ }
+ }
+ throw new NoSuchConfigRevisionException();
+ }
+
+
/**
* List files in a given channel
* @param sessionKey the session key
diff --git a/java/code/src/com/redhat/rhn/manager/configuration/ConfigurationManager.java b/java/code/src/com/redhat/rhn/manager/configuration/ConfigurationManager.java
index b6cc73f..9fd4007 100644
--- a/java/code/src/com/redhat/rhn/manager/configuration/ConfigurationManager.java
+++ b/java/code/src/com/redhat/rhn/manager/configuration/ConfigurationManager.java
@@ -43,6 +43,7 @@ import com.redhat.rhn.frontend.dto.ConfigChannelDto;
import com.redhat.rhn.frontend.dto.ConfigFileDto;
import com.redhat.rhn.frontend.dto.ConfigFileNameDto;
import com.redhat.rhn.frontend.dto.ConfigGlobalDeployDto;
+import com.redhat.rhn.frontend.dto.ConfigRevisionDto;
import com.redhat.rhn.frontend.dto.ConfigSystemDto;
import com.redhat.rhn.frontend.listview.PageControl;
import com.redhat.rhn.manager.BaseManager;
@@ -1119,7 +1120,7 @@ public class ConfigurationManager extends BaseManager {
* @param pc controller/elaborator for the list
* @return List of revisions in dto format.
*/
- public DataResult listRevisionsForFile(User user, ConfigFile file, PageControl pc) {
+ public DataResult<ConfigRevisionDto> listRevisionsForFile(User user, ConfigFile file, PageControl pc) {
Map params = new HashMap();
params.put("cfid", file.getId());
params.put("user_id", user.getId());
diff --git a/web/conf/rhn_web.conf b/web/conf/rhn_web.conf
index b032acf..b83d419 100644
--- a/web/conf/rhn_web.conf
+++ b/web/conf/rhn_web.conf
@@ -224,7 +224,7 @@ web.config_delim_end = |}
web.version = 1.1
# the version of API
-web.apiversion = 10.11
+web.apiversion = 10.12
# maximum size for a config file
web.maximum_config_file_size = 131072
13 years, 8 months
2 commits - java/code
by Miroslav Suchý
java/code/webapp/WEB-INF/pages/systems/probes/edit.jsp | 20 ++++++++--------
java/code/webapp/WEB-INF/pages/systems/systemsearch.jsp | 16 ++++++------
2 files changed, 18 insertions(+), 18 deletions(-)
New commits:
commit 1c87c97218cb746584b1bcad1dc9fb84bc2d19e4
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Sep 15 17:10:25 2010 +0200
implement <label> for form fields - systems/probes/edit.jsp
diff --git a/java/code/webapp/WEB-INF/pages/systems/probes/edit.jsp b/java/code/webapp/WEB-INF/pages/systems/probes/edit.jsp
index d68eed6..64e70a0 100644
--- a/java/code/webapp/WEB-INF/pages/systems/probes/edit.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/probes/edit.jsp
@@ -52,18 +52,18 @@ function refreshNotifFields() {
</tr>
</c:if>
<tr>
- <th><bean:message key="probeedit.jsp.description" /></th>
- <td colspan="3"><html:text property="description" maxlength="100" size="50" /></td>
+ <th><label for="description"><bean:message key="probeedit.jsp.description" /></label></th>
+ <td colspan="3"><html:text property="description" maxlength="100" size="50" styleId="description"/></td>
</tr>
<tr>
- <th><bean:message key="probeedit.jsp.notification" /></th>
- <td colspan="3"><html:checkbox onclick="refreshNotifFields()" property="notification" /></td>
+ <th><label for="notification"><bean:message key="probeedit.jsp.notification" /></label></th>
+ <td colspan="3"><html:checkbox onclick="refreshNotifFields()" property="notification" styleId="notification"/></td>
</tr>
<tr>
- <th><bean:message key="probeedit.jsp.notifmin" /></th>
+ <th><label for="notifmin"><bean:message key="probeedit.jsp.notifmin" /></label></th>
<td colspan="3">
<html:select property="notification_interval_min"
- disabled="${not probeEditForm.map.notification}">
+ disabled="${not probeEditForm.map.notification}" styleId="notifmin">
<html:options collection="intervals"
property="value"
labelProperty="label" />
@@ -71,9 +71,9 @@ function refreshNotifFields() {
</td>
</tr>
<tr>
- <th><bean:message key="probeedit.jsp.notifmethod" /></th>
+ <th><label for="notifmethod"><bean:message key="probeedit.jsp.notifmethod" /></label></th>
<td colspan="3"><html:select property="contact_group_id"
- disabled="${not probeEditForm.map.notification}">
+ disabled="${not probeEditForm.map.notification}" styleId="notifmethod">
<html:options collection="contactGroups"
property="value"
labelProperty="label" />
@@ -81,9 +81,9 @@ function refreshNotifFields() {
</td>
</tr>
<tr>
- <th><bean:message key="probeedit.jsp.checkinterval" /></th>
+ <th><label for="checkinterval"><bean:message key="probeedit.jsp.checkinterval" /></label></th>
<td colspan="3">
- <html:select property="check_interval_min">
+ <html:select property="check_interval_min" styleId="checkinterval">
<html:options collection="intervals"
property="value"
labelProperty="label" />
commit 7e9c4294c8dba6e08dafa48263511b1c2c48db9b
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Sep 15 16:57:03 2010 +0200
implement <label> for form fields - systems/systemsearch.jsp
diff --git a/java/code/webapp/WEB-INF/pages/systems/systemsearch.jsp b/java/code/webapp/WEB-INF/pages/systems/systemsearch.jsp
index d0b1e99..3ff16a3 100644
--- a/java/code/webapp/WEB-INF/pages/systems/systemsearch.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/systemsearch.jsp
@@ -20,9 +20,9 @@
<div class="search-choices">
<div class="search-choices-group">
<table class="details">
- <tr><th><bean:message key="erratasearch.jsp.searchfor"/></th>
+ <tr><th><label for="searchfor"><bean:message key="erratasearch.jsp.searchfor"/></label></th>
<td>
- <html:text property="search_string" name="search_string"
+ <html:text property="search_string" name="search_string" styleId="searchfor"
value="${search_string}" maxlength="36" />
<html:submit>
<bean:message key="button.search" />
@@ -30,9 +30,9 @@
</td>
</tr>
<tr>
- <th><bean:message key="systemsearch.jsp.fieldtosearch"/></th>
+ <th><label for="fieldtosearch"><bean:message key="systemsearch.jsp.fieldtosearch"/></label></th>
<td>
- <select name="view_mode" >
+ <select name="view_mode" styleId="fieldtosearch">
<c:forEach items="${optGroupsKeys}" var="key">
<optgroup label="<bean:message key="${key}"/>">
<c:forEach items="${optGroupsMap[key]}" var="option">
@@ -55,19 +55,19 @@
<th><bean:message key="systemsearch.jsp.wheretosearch"/></th>
<td>
<div style="text-align: left">
- <html:radio property="whereToSearch" value="all"/><bean:message key="systemsearch.jsp.searchallsystems"/>
+ <html:radio property="whereToSearch" value="all" styleId="whereToSearch-all"/><label for="whereToSearch-all"><bean:message key="systemsearch.jsp.searchallsystems"/></label>
</div>
<div style="text-align: left">
- <html:radio property="whereToSearch" value="system_list"/><bean:message key="systemsearch.jsp.searchSSM"/>
+ <html:radio property="whereToSearch" value="system_list" styleId="whereToSearch-system_list"/><label for="whereToSearch-system_list"><bean:message key="systemsearch.jsp.searchSSM"/></label>
</div>
</td>
</tr>
<tr>
- <th><bean:message key="systemsearch.jsp.invertlabel"/></th>
+ <th><label for="invertlabel"><bean:message key="systemsearch.jsp.invertlabel"/></label></th>
<td>
<div style="text-align: left">
- <html:checkbox property="invert"><bean:message key="systemsearch.jsp.invertdescription"/></html:checkbox>
+ <html:checkbox property="invert" styleId="invertlabel"><label for="invertlabel"><bean:message key="systemsearch.jsp.invertdescription"/></label></html:checkbox>
</div>
</td>
</tr>
13 years, 8 months
spacewalk/setup
by Milan Zazrivec
spacewalk/setup/lib/Spacewalk/Setup.pm | 7 -------
1 file changed, 7 deletions(-)
New commits:
commit 36019a745f22e16aff911dd50d95509147940760
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Wed Sep 15 15:09:34 2010 +0200
need_oracle_9i_10g_upgrade is no longer needed
diff --git a/spacewalk/setup/lib/Spacewalk/Setup.pm b/spacewalk/setup/lib/Spacewalk/Setup.pm
index 934ae8a..d071383 100644
--- a/spacewalk/setup/lib/Spacewalk/Setup.pm
+++ b/spacewalk/setup/lib/Spacewalk/Setup.pm
@@ -938,13 +938,6 @@ sub oracle_check_for_users_and_groups {
}
}
-sub need_oracle_9i_10g_upgrade {
- my $orahome = qx{dbhome embedded};
- chomp($orahome);
- my $spfile = $orahome. "/dbs/spfilerhnsat.ora";
- return (not -r $spfile);
-}
-
sub oracle_setup_embedded_db {
my $opts = shift;
my $answers = shift;
13 years, 8 months
spacewalk/setup
by Milan Zazrivec
spacewalk/setup/lib/Spacewalk/Setup.pm | 5 -
spacewalk/setup/share/oracle/upgrade-db-10g.sh | 72 -------------------------
spacewalk/setup/share/oracle/upgrade-db.sh | 34 +++++++----
spacewalk/setup/spacewalk-setup.spec | 1
4 files changed, 24 insertions(+), 88 deletions(-)
New commits:
commit c9910bf121159b31e72be6e9b3d397f89dcc3f58
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Wed Sep 15 14:56:14 2010 +0200
unify embedded database upgrades
There's no point in forcing Satellite customers to have to choose
embedded database upgrade scenario. We're able to detect the correct
scenario automatically.
diff --git a/spacewalk/setup/lib/Spacewalk/Setup.pm b/spacewalk/setup/lib/Spacewalk/Setup.pm
index 408b5d6..934ae8a 100644
--- a/spacewalk/setup/lib/Spacewalk/Setup.pm
+++ b/spacewalk/setup/lib/Spacewalk/Setup.pm
@@ -969,9 +969,6 @@ sub oracle_setup_embedded_db {
if ($opts->{'upgrade'}) {
- my $upgrade_script = "upgrade-db-10g.sh";
- need_oracle_9i_10g_upgrade() and $upgrade_script = "upgrade-db.sh";
-
printf loc(<<EOQ, DB_UPGRADE_LOG_FILE);
** Database: Upgrading the database server to latest Oracle 10g:
** Database: This is a long process that is logged in:
@@ -983,7 +980,7 @@ EOQ
-err_message => "Could not upgrade database.\n",
-err_code => 15,
-system_opts => ['/sbin/runuser', 'oracle', '-c',
- SHARED_DIR . '/oracle/' . $upgrade_script .
+ SHARED_DIR . '/oracle/upgrade-db.sh' .
" --db $answers->{'db-name'}" .
" --user $answers->{'db-user'}"]);
diff --git a/spacewalk/setup/share/oracle/upgrade-db-10g.sh b/spacewalk/setup/share/oracle/upgrade-db-10g.sh
deleted file mode 100644
index 1bbee9d..0000000
--- a/spacewalk/setup/share/oracle/upgrade-db-10g.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/sh
-# Upgrades RHN embedded database at mountpoint /rhnsat (10g ver 10.2.0.3 -> 10g ver. 10.2.0.4)
-#
-# Copyright (c) 2009 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-
-set -x
-
-# exit if anything fails
-set -e
-
-DB_NAME="rhnsat"
-DB_USER="rhnsat"
-
-if [ ${#} -gt 0 ]; then
- while [ -n "$1" ] ; do
- case $1 in
- -d | --db | --database )
- shift
- DB_NAME=$1
- ;;
- -u | --user* )
- shift
- DB_USER=$1
- ;;
- * )
- exit -1
- ;;
- esac
- shift
- done
-fi
-
-# set oracle environment to embedded server
-ORAENV_ASK=NO
-ORACLE_BASE=/opt/apps/oracle
-ORACLE_ADMIN_DIR=$ORACLE_BASE/admin/10.2.0
-ORACLE_CONFIG_DIR=$ORACLE_BASE/config/10.2.0
-
-# change env to rhnsat instance
-export ORACLE_SID=$DB_NAME
-. oraenv
-
-# If the record for satellite database exists, substitute it with new value.
-# Otherwise create a new record.
-if grep -q "^$ORACLE_SID:.*$" /etc/oratab; then
- oratab=$(sed "s;^$ORACLE_SID:.*$;$ORACLE_SID:$ORACLE_HOME:Y;" /etc/oratab)
- echo "$oratab" > /etc/oratab
-else
- echo "$ORACLE_SID:$ORACLE_HOME:Y" >> /etc/oratab
-fi
-
-# upgrade database
-UPGRADE_TMPL=$ORACLE_ADMIN_DIR/embedded-upgradedb-10g.tmpl
-m4 $UPGRADE_TMPL -I$ORACLE_ADMIN_DIR \
- --define RHNORA_DBNAME=$ORACLE_SID \
- --define RHNORA_LOG_PATH=/rhnsat/admin/rhnsat/logs \
- --define RHNORA_DATA_PATH=/rhnsat/data/rhnsat \
- --define RHNORA_DB_USER=$DB_USER \
- | $ORACLE_HOME/bin/sqlplus /nolog
-
-set +x
diff --git a/spacewalk/setup/share/oracle/upgrade-db.sh b/spacewalk/setup/share/oracle/upgrade-db.sh
index bd0f291..e3e8eea 100644
--- a/spacewalk/setup/share/oracle/upgrade-db.sh
+++ b/spacewalk/setup/share/oracle/upgrade-db.sh
@@ -41,6 +41,12 @@ if [ ${#} -gt 0 ]; then
done
fi
+if [ -r "$(dbhome embedded)/dbs/spfilerhnsat.ora" ]; then
+ MAJOR_DB_UPGRADE=0
+else
+ MAJOR_DB_UPGRADE=1
+fi
+
# set oracle environment to embedded server
ORAENV_ASK=NO
ORACLE_SID=embedded
@@ -59,6 +65,8 @@ export ORACLE_SID=$DB_NAME
# If the record for satellite database exists, substitute it with new value.
# Otherwise create a new record.
if grep -q "^$ORACLE_SID:.*$" /etc/oratab; then
+ # We cannot do in-place edit, since we're running under oracle user and
+ # do not have write access to /etc
oratab=$(sed "s;^$ORACLE_SID:.*$;$ORACLE_SID:$ORACLE_HOME:Y;" /etc/oratab)
echo "$oratab" > /etc/oratab
else
@@ -73,13 +81,13 @@ LISTENER_ORA=network/admin/listener.ora
sed "s|\(ORACLE_HOME=.*\)|(ORACLE_HOME=$ORACLE_HOME)|" \
$ORACLE_9I_HOME/$LISTENER_ORA >$ORACLE_HOME/$LISTENER_ORA
-
-# modify db init files
-cp -a $ORACLE_CONFIG_9I_DIR/* $ORACLE_CONFIG_DIR/
-UPGRADE_PFILE=$ORACLE_CONFIG_DIR/upgrade-init$ORACLE_SID.ora
-cat $ORACLE_ADMIN_DIR/init-params.ora >$UPGRADE_PFILE
-grep --text -E -f - $ORACLE_CONFIG_9I_DIR/spfile$ORACLE_SID.ora \
- >>$UPGRADE_PFILE <<EOPATTERNS
+# for 9i -> 10g upgrades, modify db init files
+if [ $MAJOR_DB_UPGRADE -gt 0 ]; then
+ cp -a $ORACLE_CONFIG_9I_DIR/* $ORACLE_CONFIG_DIR/
+ UPGRADE_PFILE=$ORACLE_CONFIG_DIR/upgrade-init$ORACLE_SID.ora
+ cat $ORACLE_ADMIN_DIR/init-params.ora >$UPGRADE_PFILE
+ grep --text -E -f - $ORACLE_CONFIG_9I_DIR/spfile$ORACLE_SID.ora \
+ >>$UPGRADE_PFILE <<EOPATTERNS
audit_file_dest
background_dump_dest
control_files
@@ -89,11 +97,16 @@ db_name
instance_name
user_dump_dest
EOPATTERNS
-echo "compatible=10.2.0.4.0" >>$UPGRADE_PFILE
+ echo "compatible=10.2.0.4.0" >>$UPGRADE_PFILE
+fi
+# upgrade the database
+if [ $MAJOR_DB_UPGRADE -gt 0 ]; then
+ UPGRADE_TMPL=$ORACLE_ADMIN_DIR/embedded-upgradedb.tmpl
+else
+ UPGRADE_TMPL=$ORACLE_ADMIN_DIR/embedded-upgradedb-10g.tmpl
+fi
-# upgrade database
-UPGRADE_TMPL=$ORACLE_ADMIN_DIR/embedded-upgradedb.tmpl
m4 $UPGRADE_TMPL -I$ORACLE_ADMIN_DIR \
--define RHNORA_DBNAME=$ORACLE_SID \
--define RHNORA_LOG_PATH=/rhnsat/admin/rhnsat/logs \
@@ -102,4 +115,3 @@ m4 $UPGRADE_TMPL -I$ORACLE_ADMIN_DIR \
| $ORACLE_HOME/bin/sqlplus /nolog
set +x
-
diff --git a/spacewalk/setup/spacewalk-setup.spec b/spacewalk/setup/spacewalk-setup.spec
index 89aa2d4..e75a16a 100644
--- a/spacewalk/setup/spacewalk-setup.spec
+++ b/spacewalk/setup/spacewalk-setup.spec
@@ -77,7 +77,6 @@ install -d -m 755 %{buildroot}/%{_datadir}/spacewalk/setup/oracle/
install -m 0755 share/oracle/install-db.sh %{buildroot}/%{_datadir}/spacewalk/setup/oracle
install -m 0755 share/oracle/remove-db.sh %{buildroot}/%{_datadir}/spacewalk/setup/oracle
install -m 0755 share/oracle/upgrade-db.sh %{buildroot}/%{_datadir}/spacewalk/setup/oracle
-install -m 0755 share/oracle/upgrade-db-10g.sh %{buildroot}/%{_datadir}/spacewalk/setup/oracle
# create a directory for misc. Spacewalk things
install -d -m 755 %{buildroot}/%{_var}/spacewalk
13 years, 8 months
schema/spacewalk
by Michael Mraka
schema/spacewalk/upgrade/spacewalk-schema-1.1-to-spacewalk-schema-1.2/081-rhnUserMessageStatus-drop-table.sql | 1 +
1 file changed, 1 insertion(+)
New commits:
commit d19bf7be8dd77e50371b28554aee13aee6cb6e18
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Sep 15 09:53:36 2010 +0200
sequence used for rhnUserMessageStatus ids should be also removed
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.1-to-spacewalk-schema-1.2/081-rhnUserMessageStatus-drop-table.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.1-to-spacewalk-schema-1.2/081-rhnUserMessageStatus-drop-table.sql
index 84fd085..a1661fa 100644
--- a/schema/spacewalk/upgrade/spacewalk-schema-1.1-to-spacewalk-schema-1.2/081-rhnUserMessageStatus-drop-table.sql
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.1-to-spacewalk-schema-1.2/081-rhnUserMessageStatus-drop-table.sql
@@ -1 +1,2 @@
drop table rhnUserMessageStatus;
+drop sequence rhn_um_status_id_seq;
13 years, 8 months
branding/img java/code
by Partha Aji
branding/img/link-config.png |binary
java/code/src/com/redhat/rhn/frontend/configuration/tags/ConfigFileTag.java | 14 +++++++---
java/code/webapp/WEB-INF/pages/common/fragments/configuration/files/header.jspf | 4 ++
3 files changed, 15 insertions(+), 3 deletions(-)
New commits:
commit 012eb0eaa080957f2700dd4983c9fc77e9dc12d8
Author: Partha Aji <paji(a)redhat.com>
Date: Tue Sep 14 18:33:03 2010 -0400
627920 - Added a larger config file icon for symlinks. Thanks to Joshua Roys
diff --git a/branding/img/link-config.png b/branding/img/link-config.png
new file mode 100644
index 0000000..a44db7f
Binary files /dev/null and b/branding/img/link-config.png differ
diff --git a/java/code/src/com/redhat/rhn/frontend/configuration/tags/ConfigFileTag.java b/java/code/src/com/redhat/rhn/frontend/configuration/tags/ConfigFileTag.java
index 42ae84d..2dc8c7c 100644
--- a/java/code/src/com/redhat/rhn/frontend/configuration/tags/ConfigFileTag.java
+++ b/java/code/src/com/redhat/rhn/frontend/configuration/tags/ConfigFileTag.java
@@ -50,6 +50,7 @@ public class ConfigFileTag extends TagSupport {
public static final String DIR_HEADER_ICON = "/img/folder-config.png";
public static final String FILE_HEADER_ICON = "/img/file-config.png";
+ public static final String SYMLINK_HEADER_ICON = "/img/link-config.png";
public static final String FILE_URL = "/rhn/configuration/file/FileDetails.do";
@@ -68,7 +69,8 @@ public class ConfigFileTag extends TagSupport {
/**
* {@inheritDoc}
*/
- public int doEndTag() throws JspException {
+ @Override
+ public int doEndTag() throws JspException {
if (nolink || id == null) {
writeIcon();
ConfigTagHelper.write(StringEscapeUtils.escapeXml(path), pageContext);
@@ -92,7 +94,8 @@ public class ConfigFileTag extends TagSupport {
/**
* {@inheritDoc}
*/
- public void release() {
+ @Override
+ public void release() {
id = null;
path = null;
type = null;
@@ -105,7 +108,8 @@ public class ConfigFileTag extends TagSupport {
/**
* @param val the id to set
*/
- public void setId(String val) {
+ @Override
+ public void setId(String val) {
this.id = val;
}
@@ -240,6 +244,10 @@ public class ConfigFileTag extends TagSupport {
"folder".equalsIgnoreCase(type)) {
return DIR_HEADER_ICON;
}
+ else if ("symlink".equalsIgnoreCase(type) ||
+ "link".equalsIgnoreCase(type)) {
+ return SYMLINK_HEADER_ICON;
+ }
return FILE_HEADER_ICON;
}
diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/configuration/files/header.jspf b/java/code/webapp/WEB-INF/pages/common/fragments/configuration/files/header.jspf
index b43b6a6..178295f 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/configuration/files/header.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/configuration/files/header.jspf
@@ -25,6 +25,10 @@
arg3="/rhn/configuration/ChannelOverview.do?ccid=${channel.id}" />
</c:set>
+<c:if test="${revision.symlink}">
+ <c:set var="fileImg" scope="request" value="/img/link-config.png" />
+ <c:set var="fileAlt" scope="request" value="config.common.symlinkAlt" />
+</c:if>
<c:choose>
<c:when test="${!revision.directory}">
13 years, 8 months
backend/satellite_tools
by Milan Zazrivec
backend/satellite_tools/satComputePkgHeaders.py | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit 2c0bb832d2c3441817b27f240d8ceeea32f08b6b
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Tue Sep 14 18:19:35 2010 +0200
initCFG('server') before initDB
This is to avoid following traceback:
Traceback (most recent call last):
File "/usr/share/rhn/satellite_tools/satComputePkgHeaders.py", line
230, in ?
sys.exit(Runner().main() or 0)
File "/usr/share/rhn/satellite_tools/satComputePkgHeaders.py", line
87, in main
rhnSQL.initDB(self.options.db)
File "/usr/share/rhn/server/rhnSQL/__init__.py", line 80, in initDB
backend=CFG.DB_BACKEND
File "/usr/share/rhn/common/rhnConfig.py", line 334, in __getattr__
self.__check()
File "/usr/share/rhn/common/rhnConfig.py", line 378, in __check
self.__component)
common.rhnConfig.ConfigParserError: ('Uninitialized config for
component', ())
diff --git a/backend/satellite_tools/satComputePkgHeaders.py b/backend/satellite_tools/satComputePkgHeaders.py
index c8e0fc1..ff62444 100644
--- a/backend/satellite_tools/satComputePkgHeaders.py
+++ b/backend/satellite_tools/satComputePkgHeaders.py
@@ -24,6 +24,7 @@ _path = "/usr/share/rhn"
if _path not in sys.path:
sys.path.append(_path)
+from common import initCFG
SERVER_RETURN = 0
@@ -84,6 +85,7 @@ class Runner:
print "--db not specified"
return 1
+ initCFG('server')
rhnSQL.initDB(self.options.db)
self._channels_hash = self._get_channels()
13 years, 8 months
spacewalk/setup
by Milan Zazrivec
spacewalk/setup/lib/Spacewalk/Setup.pm | 53 ++++++-----------
spacewalk/setup/share/upgrade/rhn-update-monitoring.pl | 10 ++-
2 files changed, 29 insertions(+), 34 deletions(-)
New commits:
commit b1bf70d3c2d1912827956c745674b58c7e0402af
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Tue Sep 14 16:47:34 2010 +0200
use standard perl dbi in update_monitoring_scout
We cannot call RHN::DB->connect at this point of the setup, since
the db connection information is not set in master rhn.conf yet.
diff --git a/spacewalk/setup/lib/Spacewalk/Setup.pm b/spacewalk/setup/lib/Spacewalk/Setup.pm
index ad40452..408b5d6 100644
--- a/spacewalk/setup/lib/Spacewalk/Setup.pm
+++ b/spacewalk/setup/lib/Spacewalk/Setup.pm
@@ -20,9 +20,7 @@ use Fcntl qw(F_GETFD F_SETFD FD_CLOEXEC);
use Params::Validate qw(validate);
Params::Validate::validation_options(strip_leading => "-");
-use RHN::SatInstall;
use RHN::Utils;
-use RHN::DataSource::Simple;
=head1 NAME
@@ -1541,62 +1539,51 @@ sub update_monitoring_scout {
return unless ($opts->{'upgrade'});
- my $org_id = RHN::SatInstall->get_satellite_org_id();
- my $ds = new RHN::DataSource::Simple(-querybase => "scout_queries",
- -mode => 'scouts_for_org');
- my $data = $ds->execute_query(-org_id => $org_id);
- my ($scout) = grep { not $_->{SERVER_ID} } @{$data};
-
- return 0 unless $scout;
-
- my ($ip, $vip) = ($scout->{IP}, $scout->{VIP});
- my ($sn_id, $sc_id) = ($scout->{SAT_NODE_ID}, $scout->{ID});
my $ip_addr = RHN::Utils::find_ip_address($answers->{'hostname'});
- my $dbh = RHN::DB->connect;
+ my $dbh = get_dbh($answers);
# If IP address for satellite / spacewalk scout was set to 127.0.0.1, it needs to be updated
- my $sql1 = q{
+ my $sql1 = qq/
update rhn_sat_node
- set ip = :ip,
+ set ip = '$ip_addr',
last_update_user = 'upgrade',
last_update_date = sysdate
where ip = '127.0.0.1' and
- recid = :recid
- };
- my $sql2 = q{
+ recid = 2/;
+
+ my $sql2 = qq/
update rhn_sat_cluster
- set vip = :vip,
+ set vip = '$ip_addr',
last_update_user = 'upgrade',
last_update_date = sysdate
where vip = '127.0.0.1' and
- recid = :recid
- };
+ recid = 1/;
# If IP address for satellite / spacewalk scout was not set, it needs to be updated
- my $sql3 = q{
+ my $sql3 = qq/
update rhn_sat_node
- set ip = :ip,
+ set ip = '$ip_addr',
last_update_user = 'upgrade',
last_update_date = sysdate
where ip is null and
- recid = :recid
- };
- my $sql4 = q{
+ recid = 2/;
+
+ my $sql4 = qq/
update rhn_sat_cluster
- set vip = :vip,
+ set vip = '$ip_addr',
last_update_user = 'upgrade',
last_update_date = sysdate
where vip is null and
- recid = :recid
- };
+ recid = 1/;
- $dbh->do_h($sql1, ip => $ip_addr, recid => $sn_id, );
- $dbh->do_h($sql2, vip => $ip_addr, recid => $sc_id,);
- $dbh->do_h($sql3, ip => $ip_addr, recid => $sn_id, );
- $dbh->do_h($sql4, vip => $ip_addr, recid => $sc_id,);
+ $dbh->do($sql1);
+ $dbh->do($sql2);
+ $dbh->do($sql3);
+ $dbh->do($sql4);
$dbh->commit;
+ $dbh->disconnect;
}
sub update_monitoring_ack_enqueuer {
diff --git a/spacewalk/setup/share/upgrade/rhn-update-monitoring.pl b/spacewalk/setup/share/upgrade/rhn-update-monitoring.pl
index 662bf2a..ed24fb5 100755
--- a/spacewalk/setup/share/upgrade/rhn-update-monitoring.pl
+++ b/spacewalk/setup/share/upgrade/rhn-update-monitoring.pl
@@ -10,8 +10,9 @@ use strict;
use warnings;
use Sys::Hostname;
-use RHN::SatInstall;
+use PXT::Config;
use Spacewalk::Setup;
+use RHN::SatInstall;
my $db_connect = RHN::SatInstall->test_db_connection();
die "Could not connect to the database" unless $db_connect;
@@ -20,6 +21,13 @@ my %answers;
my %opts;
$answers{'hostname'} = Sys::Hostname::hostname;
+$answers{'db-backend'} = PXT::Config->get('db_backend');
+$answers{'db-host'} = PXT::Config->get('db_host');
+$answers{'db-port'} = PXT::Config->get('db_port');
+$answers{'db-name'} = PXT::Config->get('db_name');
+$answers{'db-user'} = PXT::Config->get('db_user');
+$answers{'db-password'} = PXT::Config->get('db_password');
+
$opts{'upgrade'} = 1;
Spacewalk::Setup::update_monitoring_scout(\%opts, \%answers);
13 years, 8 months
rel-eng/tito.props
by Jan Pazdziora
rel-eng/tito.props | 7 -------
1 file changed, 7 deletions(-)
New commits:
commit d2b65edb8e21ab25d3030d639cb138a50ae46a77
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Sep 14 16:44:34 2010 +0200
Remove the cvs targets.
diff --git a/rel-eng/tito.props b/rel-eng/tito.props
index dfd8c57..8f98819 100644
--- a/rel-eng/tito.props
+++ b/rel-eng/tito.props
@@ -15,10 +15,3 @@ blacklist=jabberd-selinux
[dist-f13-sw-1.2-candidate]
disttag = .fc13
blacklist=jabberd-selinux
-
-[satellite-5.4-rhel-5-candidate]
-blacklist = python-hwdata spacewalk-proxy-html spacecmd spacewalk spacewalk-repo
-
-[cvs]
-cvsroot = :gserver:cvs.devel.redhat.com:/cvs/dist
-branches = SATELLITE-5_4-RHEL-5
13 years, 8 months