client/tools
by Miroslav Suchý
client/tools/rhncfg/actions/configfiles | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit d6492c22f4708d669f2f11311ce54950e5be3f6d
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon May 17 12:21:16 2010 +0200
515637 - add newline at the end of file
sed on solaris cut last line, if it does not end with /n
diff --git a/client/tools/rhncfg/actions/configfiles b/client/tools/rhncfg/actions/configfiles
index 9d49fd4..ce4e023 100644
--- a/client/tools/rhncfg/actions/configfiles
+++ b/client/tools/rhncfg/actions/configfiles
@@ -2,4 +2,5 @@ configfiles.mtime_upload(1)=1
configfiles.upload(1)=1
configfiles.deploy(1)=1
configfiles.diff(1)=1
-configfiles.base64_enc(1)=1
\ No newline at end of file
+configfiles.base64_enc(1)=1
+
14 years
java/code
by Justin Sherrill
java/code/src/com/redhat/rhn/domain/server/test/ServerFactoryTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit e5bde463c47ea6e50bae0fc648b320fa9d24d4ed
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Fri May 14 18:17:16 2010 -0400
unit test fix
diff --git a/java/code/src/com/redhat/rhn/domain/server/test/ServerFactoryTest.java b/java/code/src/com/redhat/rhn/domain/server/test/ServerFactoryTest.java
index 4636f3e..68f3016 100644
--- a/java/code/src/com/redhat/rhn/domain/server/test/ServerFactoryTest.java
+++ b/java/code/src/com/redhat/rhn/domain/server/test/ServerFactoryTest.java
@@ -432,7 +432,7 @@ public class ServerFactoryTest extends RhnBaseTestCase {
public void testGetChildChannels() throws Exception {
Server s1 = ServerTestUtils.createTestSystem(usr);
- assertNull(s1.getChildChannels());
+ assertTrue(s1.getChildChannels().isEmpty());
s1.addChannel(ChannelTestUtils.createChildChannel(usr, s1.getBaseChannel()));
s1.addChannel(ChannelTestUtils.createChildChannel(usr, s1.getBaseChannel()));
14 years
client/tools
by Justin Sherrill
client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py | 1 +
1 file changed, 1 insertion(+)
New commits:
commit efe6610f5738956e4769dffd89a6dfc47d7d4cc1
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Fri May 14 17:32:06 2010 -0400
initializing variable within koan that is not initialized
diff --git a/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py b/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py
index c26d2e0..328d70c 100644
--- a/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py
+++ b/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py
@@ -188,6 +188,7 @@ def initiate_guest(kickstart_host, cobbler_system_name, virt_type, name, mem_kb,
k.no_gfx = 1
k.add_reinstall_entry = None
k.kopts_override = None
+ k.virt_auto_boot = None
k.run()
# refresh current virtualization state on the server
14 years
branding/css java/code
by Partha Aji
branding/css/rhn-listview.css | 5 +++++
java/code/src/com/redhat/rhn/frontend/taglibs/list/row/ExpandableRowRenderer.java | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
New commits:
commit b424ae753f36f844b1dd7aa30ca89cb4b98793ae
Author: Partha Aji <paji(a)redhat.com>
Date: Fri May 14 16:25:10 2010 -0400
Adding the correct checkstyle for inactive systems
diff --git a/branding/css/rhn-listview.css b/branding/css/rhn-listview.css
index ebb136b..f27c487 100644
--- a/branding/css/rhn-listview.css
+++ b/branding/css/rhn-listview.css
@@ -571,6 +571,11 @@ tr.alphaResult td.sortedCol {
background-color: #e4e4e4;
}
+.inactive {
+ background-color: #fef5ad;
+ margin-bottom: 5px;
+}
+
.compare-list .inactive {
background-color: #fef5ad;
margin-bottom: 5px;
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/row/ExpandableRowRenderer.java b/java/code/src/com/redhat/rhn/frontend/taglibs/list/row/ExpandableRowRenderer.java
index 5e50127..24707cd 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/row/ExpandableRowRenderer.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/row/ExpandableRowRenderer.java
@@ -47,7 +47,7 @@ public class ExpandableRowRenderer extends RowRenderer {
else {
NetworkDto dto = (NetworkDto) current;
if (dto.getInactive() > 0) {
- return rowClasses[rowNum % rowClasses.length] + " alphaResult";
+ return " inactive";
}
return rowClasses[rowNum % rowClasses.length];
}
14 years
2 commits - java/code search-server/spacewalk-search
by Justin Sherrill
java/code/src/com/redhat/rhn/frontend/action/errata/ErrataSearchAction.java | 4
search-server/spacewalk-search/buildconf/exclude | 2
search-server/spacewalk-search/scripts/src/java/com/redhat/satellite/search/index/docs/WebCrawl.java | 304 ----------
search-server/spacewalk-search/src/config/com/redhat/satellite/search/db/errata_handler.xml | 2
search-server/spacewalk-search/src/java/com/redhat/satellite/search/scheduler/tasks/IndexDocumentsTask.java | 140 ----
5 files changed, 2 insertions(+), 450 deletions(-)
New commits:
commit 7cacc612569df36d2af6826ce2889755edcfc7b3
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Fri May 14 11:47:01 2010 -0400
576953 - fixing errata search case sensitivity and not searching on partial cve name
diff --git a/java/code/src/com/redhat/rhn/frontend/action/errata/ErrataSearchAction.java b/java/code/src/com/redhat/rhn/frontend/action/errata/ErrataSearchAction.java
index f412422..0c2cced 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/errata/ErrataSearchAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/errata/ErrataSearchAction.java
@@ -574,9 +574,7 @@ public class ErrataSearchAction extends RhnAction {
return "(name:(" + query + ") filename:(" + query + "))";
}
else if (OPT_CVE.equals(mode)) {
- if (query.trim().toLowerCase().indexOf("cve-") == -1) {
- query = "CVE-" + query;
- }
+ query = "%" + query.toLowerCase() + "%";
return "listErrataByCVE:(" + query + ")";
}
diff --git a/search-server/spacewalk-search/src/config/com/redhat/satellite/search/db/errata_handler.xml b/search-server/spacewalk-search/src/config/com/redhat/satellite/search/db/errata_handler.xml
index 7c6cece..6dc5f19 100644
--- a/search-server/spacewalk-search/src/config/com/redhat/satellite/search/db/errata_handler.xml
+++ b/search-server/spacewalk-search/src/config/com/redhat/satellite/search/db/errata_handler.xml
@@ -23,7 +23,7 @@
ac.org_id = wc.org_id and
ps.web_user_id = wc.id and
ps.id = #sessionId# and
- cve.name = #param0#
+ LOWER(cve.name) like #param0#
</select>
<select id="listErrataByIssueDateRange"
commit 7fbdf029cf8666a5033032755da3421af4c69f5a
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Thu May 13 15:03:17 2010 -0400
removing some dead code from the search server
diff --git a/search-server/spacewalk-search/buildconf/exclude b/search-server/spacewalk-search/buildconf/exclude
index 7873251..e69de29 100644
--- a/search-server/spacewalk-search/buildconf/exclude
+++ b/search-server/spacewalk-search/buildconf/exclude
@@ -1,2 +0,0 @@
-**/WebCrawl.java
-**/IndexDocumentsTask.java
diff --git a/search-server/spacewalk-search/scripts/src/java/com/redhat/satellite/search/index/docs/WebCrawl.java b/search-server/spacewalk-search/scripts/src/java/com/redhat/satellite/search/index/docs/WebCrawl.java
deleted file mode 100644
index d656813..0000000
--- a/search-server/spacewalk-search/scripts/src/java/com/redhat/satellite/search/index/docs/WebCrawl.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/**
- * Copyright (c) 2008--2010 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.
- */
-package com.redhat.satellite.search.index.docs;
-
-import org.apache.nutch.crawl.Injector;
-import org.apache.nutch.crawl.Generator;
-import org.apache.nutch.crawl.CrawlDb;
-import org.apache.nutch.crawl.LinkDb;
-import org.apache.nutch.fetcher.Fetcher;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapred.JobConf;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.nutch.parse.ParseSegment;
-import org.apache.nutch.indexer.DeleteDuplicates;
-import org.apache.nutch.indexer.IndexMerger;
-import org.apache.nutch.indexer.Indexer;
-import org.apache.nutch.util.HadoopFSUtil;
-import org.apache.nutch.util.NutchConfiguration;
-import org.apache.nutch.util.NutchJob;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.PosixParser;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Options;
-
-import org.apache.commons.cli.ParseException;
-
-import org.apache.log4j.Logger;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.io.IOException;
-
-
-/**
-Crawls a set of urls and indexes their content.
-Based off of nutch's crawl
- *
- * @version $Rev: $
- */
-public class WebCrawl {
- private static Logger log = Logger.getLogger(WebCrawl.class);
-
- private Configuration conf;
- private JobConf job;
- private String inputUrlFile;
- private String tmpCrawlDir;
- private String outputIndexDir;
-
- private int depth;
- private int threads;
- private long topN;
-
- /**
- * Constructor
- */
- public WebCrawl() {
- conf = NutchConfiguration.create();
- conf.addResource("crawl-tool.xml");
- job = new NutchJob(conf);
- threads = job.getInt("fetcher.threads.fetch", 10);
- depth = 5;
- topN = Long.MAX_VALUE;
- }
-
- /**
- * @return Returns the dir used to store tmp crawl data
- */
- public String getTmpCrawlDir() {
- return tmpCrawlDir;
- }
- /**
- * @param tmpCrawlDirIn the dir used to store tmp crawl data
- */
- public void setTmpCrawlDir(String tmpCrawlDirIn) {
- tmpCrawlDir = tmpCrawlDirIn;
- }
- /**
- * @return Returns the file used to seed the url crawl
- */
- public String getInputUrlFile() {
- return inputUrlFile;
- }
- /**
- * @param inputUrlFileIn file used to seed the url crawl
- */
- public void setInputUrlFile(String inputUrlFileIn) {
- inputUrlFile = inputUrlFileIn;
- }
- /**
- * @return Returns the dir to store the index of the crawled docs
- */
- public String getOutputIndexDir() {
- return outputIndexDir;
- }
- /**
- * @param outputIndexDirIn the dir to store the index of the crawled docs
- */
- public void setOutputIndexDir(String outputIndexDirIn) {
- outputIndexDir = outputIndexDirIn;
- }
- /**
- * @return Returns the maximum depth of recursion allowed
- */
- public int getDepth() {
- return depth;
- }
- /**
- * @param depthIn the maximum depth of recursion allowed
- */
- public void setDepth(int depthIn) {
- depth = depthIn;
- }
- /**
- * @return Returns the maximum number of fetcher threads used
- */
- public int getThreads() {
- return threads;
- }
- /**
- * @param threadsIn the maximum number of fetcher threads used
- */
- public void setThreads(int threadsIn) {
- threads = threadsIn;
- }
- /**
- * @return Returns the maximum number of "out links" to follow in any given page
- */
- public long getTopN() {
- return topN;
- }
- /**
- * @param topNIn the maximum number of "out links" to follow in any given page
- */
- public void setTopN(long topNIn) {
- topN = topNIn;
- }
-
- protected String getDate() {
- return new SimpleDateFormat("yyyyMMddHHmmss").format(
- new Date(System.currentTimeMillis()));
- }
-
- /**
- * Uses nutch to crawl a list of ulrs defined in "inputUrlFile"
- * Temporary scratch storage is held at "tmpCrawlDir"
- * The desired output is an index of crawled pages, stored at "outputIndexDir"
- *
- * @return true when urls successfully crawled/indexed
- */
- @SuppressWarnings("deprecation")
- public boolean crawl() throws IOException {
- log.info("Performing crawl with following config options: ");
- log.info("inputUrlFile = " + inputUrlFile);
- log.info("tmpCrawlDir = " + tmpCrawlDir);
- log.info("outputIndexDir = " + outputIndexDir);
- log.info("threads = " + threads);
- log.info("depth = " + depth);
- log.info("topN = " + topN);
-
- Path inputPath = new Path(inputUrlFile);
- Path linkDb = new Path(tmpCrawlDir + "/linkdb");
- Path segments = new Path(tmpCrawlDir + "/segments");
- Path indexes = new Path(tmpCrawlDir + "/indexes");
- Path index = new Path(outputIndexDir);
- Path crawlDb = new Path(tmpCrawlDir + "/crawldb");
-
- Path tmpDir = job.getLocalPath("crawl" + Path.SEPARATOR + getDate());
- Injector injector = new Injector(conf);
- Generator generator = new Generator(conf);
- Fetcher fetcher = new Fetcher(conf);
- ParseSegment parseSegment = new ParseSegment(conf);
- CrawlDb crawlDbTool = new CrawlDb(conf);
- LinkDb linkDbTool = new LinkDb(conf);
- Indexer indexer = new Indexer(conf);
- DeleteDuplicates dedup = new DeleteDuplicates(conf);
- IndexMerger merger = new IndexMerger(conf);
-
- FileSystem fs = FileSystem.get(job);
-
- log.info("Create a new database (crawlDB) of link information");
- injector.inject(crawlDb, inputPath);
-
- for (int i = 0; i < depth; i++) {
- log.info("Generate a fetch list from info in the crawlDB.");
- Path segment = generator.generate(crawlDb, segments, -1, topN,
- System.currentTimeMillis());
- if (segment == null) {
- log.info("Stopping at depth = " + i + " instead of " + (depth - 1) +
- " - no more URLs to fetch.");
- break;
- }
- log.info("Fetch links");
- fetcher.fetch(segment, threads); // fetch it
- if (!Fetcher.isParsing(job)) {
- log.info("Parsing Segment");
- parseSegment.parse(segment); // parse it, if needed
- }
- Path[] p = new Path[1];
- p[0] = segment;
- log.info("Update CrawlDB");
- crawlDbTool.update(crawlDb, p, true, true); // update crawldb
- }
-
- linkDbTool.invert(linkDb, segments, true, true, false); // invert links
-
- // Delete old indexes
- if (fs.exists(indexes)) {
- log.info("Deleting old indexes: $indexes");
- fs.delete(indexes);
- }
-
- // Delete old index
- if (fs.exists(index)) {
- log.info("Deleting old merged index: $index");
- fs.delete(index);
- }
-
- // index, dedup & merge
- indexer.index(indexes, crawlDb, linkDb,
- fs.listPaths(segments, HadoopFSUtil.getPassAllFilter()));
-
- Path[] p = new Path[1];
- p[0] = indexes;
- dedup.dedup(p);
- merger.merge(fs.listPaths(indexes, HadoopFSUtil.getPassAllFilter()),
- index, tmpDir);
- log.info("Crawl finished");
- return true;
- }
-
-
- /**
- * Performs a web crawl:
- * @param args command line arguments
- */
- public static void main(String[] args) throws IOException {
-
- WebCrawl wCrawl = new WebCrawl();
-
- Options options = new Options();
- options.addOption("i", "inputUrlFile", true,
- "file holding 'urls' file to seed web page crawling");
- options.addOption("o", "outputDir", true, "temp crawl output dir");
- options.addOption("x", "docsIndexDir", true, "docs index output dir");
- options.addOption("t", "threads", true, "number of threads");
- options.addOption("d", "depth", true, "depth to recurse towards");
- options.addOption("n", "topN", true, "maximum number of out links to follow");
- options.addOption("h", "help", false, "print help message");
-
- CommandLineParser parser = new PosixParser();
- try {
- CommandLine line = parser.parse(options, args);
-
- if (line.hasOption("h")) {
- HelpFormatter formatter = new HelpFormatter();
- formatter.printHelp("WebCrawl", options);
- return;
- }
- if (line.hasOption("i")) {
- wCrawl.setInputUrlFile(line.getOptionValue("i"));
- }
- if (line.hasOption("x")) {
- wCrawl.setOutputIndexDir(line.getOptionValue("x"));
- }
- if (line.hasOption("o")) {
- wCrawl.setTmpCrawlDir(line.getOptionValue("o"));
- }
- if (line.hasOption("t")) {
- wCrawl.setThreads(Integer.parseInt(line.getOptionValue("t")));
- }
- if (line.hasOption("d)")) {
- wCrawl.setDepth(Integer.parseInt(line.getOptionValue("d")));
- }
- if (line.hasOption("n")) {
- wCrawl.setTopN(Integer.parseInt(line.getOptionValue("n")));
- }
-
- }
- catch (ParseException exp) {
- System.err.println("Parsing failed. Reason: " + exp.getMessage());
- }
-
- if (!wCrawl.crawl()) {
- System.err.println("Error -- WebCrawl.crawl() Failed!");
- }
- }
-
-
-}
diff --git a/search-server/spacewalk-search/src/java/com/redhat/satellite/search/scheduler/tasks/IndexDocumentsTask.java b/search-server/spacewalk-search/src/java/com/redhat/satellite/search/scheduler/tasks/IndexDocumentsTask.java
deleted file mode 100644
index 9e36602..0000000
--- a/search-server/spacewalk-search/src/java/com/redhat/satellite/search/scheduler/tasks/IndexDocumentsTask.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/**
- * Copyright (c) 2008--2010 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.
- */
-package com.redhat.satellite.search.scheduler.tasks;
-
-import com.redhat.satellite.search.config.Configuration;
-import com.redhat.satellite.search.index.IndexManager;
-import com.redhat.satellite.search.scheduler.tasks.crawl.WebCrawl;
-
-import org.apache.log4j.Logger;
-
-import org.quartz.JobDataMap;
-import org.quartz.StatefulJob;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-
-import java.io.File;
-import java.io.IOException;
-
-
-/**
- * Task to index help documents
- *
- * @version $Rev: $
- */
-public class IndexDocumentsTask implements StatefulJob {
- // We do _not_ want this task to run concurrently with itself,
- // therefore using StatefulJob.
- private static Logger log = Logger.getLogger(IndexDocumentsTask.class);
- public static final String TASK_REINDEX = new String("TASK.RE-INDEX");
- public static final String TASK_COMPLETE = new String("TASK.COMPLETE");
-
-
- /**
- * {@inheritDoc}
- */
- public void execute(JobExecutionContext ctx)
- throws JobExecutionException {
- JobDataMap jobData = ctx.getJobDetail().getJobDataMap();
- IndexManager indexManager = (IndexManager) jobData.get("indexManager");
-
- String indexWorkDir = indexManager.getIndexWorkDir();
- if ((indexWorkDir == null) || (indexWorkDir.compareTo("") == 0)) {
- throw new JobExecutionException("indexWorkDir invalid");
- }
- File docsIndexDir = new File(indexWorkDir + File.separator +
- IndexManager.DOCS_INDEX_NAME);
- File indexCheck = new File(docsIndexDir, TASK_REINDEX);
- File success = new File(docsIndexDir, TASK_COMPLETE);
-
- boolean reindex = false;
-
- log.info("task running");
-
- if (!docsIndexDir.exists()) {
- // first time running, the index needs to be created from scratch
- log.info("Creating directory: " + docsIndexDir.getPath());
- if (!docsIndexDir.mkdirs()) {
- throw new JobExecutionException("Unable to create dir: " +
- docsIndexDir.getPath());
- }
- reindex = true;
- }
- else {
- // Will reindex if a TASK.RE-INDEX is present or
- // we don't see TASK.COMPLETE
- log.info("docsIndexDir<" + docsIndexDir + "> exists");
- if (indexCheck.exists()) {
- log.info("Found (" + indexCheck.getPath() +
- "), Index needs to be updated.");
- reindex = true;
- }
- else if (!success.exists()) {
- log.info("Index exists, but it appears to be incomplete, missing " +
- success.getPath());
- reindex = true;
- }
- }
-
- if (reindex) {
- //We need to communicate index is incomplete by removing the success file
-
- if (success.exists()) {
- if (!success.delete()) {
- throw new JobExecutionException("Unable to delete file: " +
- success.getPath());
- }
- }
- if ((indexCheck != null) && (indexCheck.exists())) {
- // cleanup the file which triggered the re-index
- if (!indexCheck.delete()) {
- throw new JobExecutionException("Unable to delete file: " +
- indexCheck.getPath());
- }
- }
- try {
- Configuration config = (Configuration)jobData.get("configuration");
- if (!reIndexDocs(docsIndexDir.getPath(), config)) {
- log.error("Failed reindexing documents to : ");
- throw new JobExecutionException("Reindexing of Documents failed.");
- }
- //Mark that docs have been indexed and are ready to be used.
- success.createNewFile();
- }
- catch (IOException e) {
- throw new JobExecutionException(e);
- }
- }
- }
-
- protected boolean reIndexDocs(String docsIndexDir, Configuration config)
- throws IOException {
-
- int threads = config.getInt("search.nutch.threads", 10);
- int depth = config.getInt("search.nutch.depth", 5);
- String inputUrlFile = config.getString("search.nutch.inputUrlFile", "nutch/urls");
- String tmpCrawlDir = config.getString("search.nutch.tmpDir", "/tmp/crawl_output");
-
- WebCrawl wCrawl = new WebCrawl();
- wCrawl.setDepth(depth);
- wCrawl.setInputUrlFile(inputUrlFile);
- wCrawl.setOutputIndexDir(docsIndexDir);
- wCrawl.setThreads(threads);
- wCrawl.setTmpCrawlDir(tmpCrawlDir);
-
- return wCrawl.crawl();
- }
-
-}
14 years
Changes to 'refs/tags/spacewalk-backend-1.1.13-1'
by Michael Mraka
Tag 'spacewalk-backend-1.1.13-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2010-05-14 12:37 +0000
Tagging package [spacewalk-backend] version [1.1.13-1] in directory [backend/].
Changes since spacewalk-java-1.1.11-1:
Jan Pazdziora (4):
591422 - add hwdata.py to rhn-client-tools.
583020 - need to initialize self.send_handler for the class Server as well.
583980 - replace fcntl.O_NDELAY with os.O_NDELAY, for newer Pythons.
557059 - we cannot have class None.
Joshua Roys (2):
Limit automatic config comparisons to diff enabled systems
checkstyle fix
Justin Sherrill (5):
unit test fix
577355 - fixing broken link on channel->errata->clone screen
adding distro deletion to cleanup script
Merge branch 'master' of ssh://git.fedorahosted.org/git/spacewalk
590204 - fixing issue where pagination wasnt working properly on normal user list page
Lukáš Ďurfina (2):
Generate Debian repository
Fix style of commit c4e387bbb1c5cf16f54a2fa968a5613121bc1d7a
Michael Mraka (5):
fixed global name 'exportLib' is not defined
xml import optimization: 'key in dict' is 15% faster than 'dict.has_key(key)' and it's called 1000000 times during satellite-sync
removed obsoleted code: at least since RHEL4 we always have unicode
don't (re)link all packages just missing ones
Automatic commit of package [spacewalk-backend] release [1.1.13-1].
Miroslav Suchý (1):
591798 - Completly remove hal code from rhn-client-tools for F-13 and RHEL-6
Partha Aji (9):
Added i18n strings for the systemdetails page
Updated a resource string
Updated a typo in the string
Fixed broken unit tests
Removed a no white space after a type cast check since we are not enforcing it anywhere
A more functional dupes compare page
Improved a error message on Dups systems page
Made the default dups compare page preselect a bunch of items
Added the dupe compare css and javascript magic
Tomas Lestach (2):
588367 move applyErrataHelper to ErrataManager
588367 - introducing systemgroup.scheduleApplyErrataToActive API call
msuchy (2):
l10n: Updates to Czech (cs) translation
l10n: Updates to Czech (cs) translation
ypoyarko (1):
l10n: Updates to Russian (ru) translation
---
backend/satellite_tools/exporter/exportLib.py | 4
backend/satellite_tools/satsync.py | 2
backend/satellite_tools/xmlDiskDumper.py | 2
backend/satellite_tools/xmlSource.py | 28
backend/spacewalk-backend.spec | 7
branding/css/rhn-listview.css | 34
client/rhel/rhn-client-tools/rhn-client-tools.spec | 7
client/rhel/rhn-client-tools/src/up2date_client/Makefile | 2
client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py | 2
client/rhel/rhnlib/rhn/nonblocking.py | 6
client/rhel/rhnlib/rhn/rpclib.py | 5
client/rhel/rhnsd/po/cs.po | 33
client/rhel/yum-rhn-plugin/po/ru.po | 39
java/buildconf/checkstyle.xml | 2
java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml | 8
java/code/src/com/redhat/rhn/domain/server/MonitoredServer.java | 4
java/code/src/com/redhat/rhn/domain/server/Server.java | 6
java/code/src/com/redhat/rhn/domain/server/ServerFactory.java | 14
java/code/src/com/redhat/rhn/domain/server/ServerGroup.hbm.xml | 1
java/code/src/com/redhat/rhn/domain/server/Server_legacyUser.hbm.xml | 9
java/code/src/com/redhat/rhn/domain/token/ActivationKeyFactory.java | 2
java/code/src/com/redhat/rhn/frontend/action/kickstart/test/KickstartSystemDetailsTest.java | 5
java/code/src/com/redhat/rhn/frontend/action/systems/duplicate/DuplicateSystemsCompareAction.java | 80 +
java/code/src/com/redhat/rhn/frontend/action/user/BaseUserListSetupAction.java | 65 -
java/code/src/com/redhat/rhn/frontend/action/user/UserListSetupAction.java | 42
java/code/src/com/redhat/rhn/frontend/dto/SystemCompareDto.java | 423 ++++++++++
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 9
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 83 +
java/code/src/com/redhat/rhn/frontend/struts/BaseSetHelper.java | 9
java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java | 5
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 55 -
java/code/src/com/redhat/rhn/frontend/xmlrpc/systemgroup/ServerGroupHandler.java | 51 +
java/code/src/com/redhat/rhn/manager/errata/ErrataManager.java | 77 +
java/code/src/com/redhat/rhn/manager/kickstart/KickstartCloneCommand.java | 4
java/code/src/com/redhat/rhn/manager/system/SystemManager.java | 7
java/code/src/com/redhat/rhn/manager/token/ActivationKeyManager.java | 4
java/code/src/com/redhat/rhn/taskomatic/task/CompareConfigFilesTask.java | 9
java/code/src/com/redhat/rhn/taskomatic/task/repomd/DebPackageWriter.java | 252 +++++
java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepositoryWriter.java | 302 +++----
java/code/src/org/cobbler/Profile.java | 6
java/code/webapp/WEB-INF/nav/sitenav-authenticated.xml | 3
java/code/webapp/WEB-INF/pages/admin/users/userlist.jsp | 4
java/code/webapp/WEB-INF/pages/common/fragments/systems/duplicates/render-item-list-list.jspf | 46 +
java/code/webapp/WEB-INF/pages/common/fragments/systems/duplicates/render-item-list.jspf | 33
java/code/webapp/WEB-INF/pages/kickstart/systemdetails.jsp | 21
java/code/webapp/WEB-INF/pages/systems/duplicate/duplicatesystemscompare.jsp | 161 +++
java/scripts/api/cleanup.py | 19
java/scripts/api/config.py | 6
rel-eng/packages/spacewalk-backend | 2
web/modules/sniglets/Sniglets/ListView/ErrataList.pm | 2
50 files changed, 1586 insertions(+), 416 deletions(-)
---
14 years
backend/spacewalk-backend.spec rel-eng/packages
by Michael Mraka
backend/spacewalk-backend.spec | 7 ++++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
New commits:
commit f741588baa67f20886d9426fd9525019a2c181eb
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 14 14:37:29 2010 +0200
Automatic commit of package [spacewalk-backend] release [1.1.13-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index a205a60..9178385 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -8,7 +8,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 1.1.12
+Version: 1.1.13
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -632,6 +632,11 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Fri May 14 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.13-1
+- fixed performance issue in satellite-sync
+- update po files
+- l10n: russian added
+
* Tue May 04 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.12-1
- modified satellite-sync to new xml dumps
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 535a9bb..72946a2 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.1.12-1 backend/
+1.1.13-1 backend/
14 years
3 commits - backend/satellite_tools
by Michael Mraka
backend/satellite_tools/satsync.py | 2 +-
backend/satellite_tools/xmlDiskDumper.py | 2 +-
backend/satellite_tools/xmlSource.py | 28 +++++++++++-----------------
3 files changed, 13 insertions(+), 19 deletions(-)
New commits:
commit e8eab333afa277988a4a23635a3de5ac9441f742
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 14 14:28:44 2010 +0200
don't (re)link all packages just missing ones
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 17eea89..8c8adef 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -1728,7 +1728,7 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
log(1, ["", messages.link_channel_packages])
package_collection = sync_handlers.PackageCollection()
uq_packages = {}
- for chn, package_ids in self._channel_packages.items():
+ for chn, package_ids in self._missing_channel_packages.items():
for pid in package_ids:
timestamp = package_collection.get_package_timestamp(pid)
package = package_collection.get_package(pid, timestamp)
commit cb2cf2fe6c0edf64f7e7e570bf4aa48e35802d0d
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 14 11:44:35 2010 +0200
removed obsoleted code: at least since RHEL4 we always have unicode
diff --git a/backend/satellite_tools/xmlSource.py b/backend/satellite_tools/xmlSource.py
index ef2d30f..7901f13 100644
--- a/backend/satellite_tools/xmlSource.py
+++ b/backend/satellite_tools/xmlSource.py
@@ -26,8 +26,6 @@ from common import log_debug, Traceback, rhnFlags, CFG
from server.importlib import importLib, backendLib
-typesHasUnicode = hasattr(types, "UnicodeType")
-
# Terminology used throughout this file:
# Item: an atomic entity from the database's perspective.
# A channel, or a package, or an erratum is an item.
@@ -336,7 +334,7 @@ class BaseItem:
def _is_string(obj):
if isinstance(obj, types.StringType):
return 1
- if typesHasUnicode and isinstance(obj, types.UnicodeType):
+ if isinstance(obj, types.UnicodeType):
return 1
return 0
@@ -344,16 +342,12 @@ def _stringify(data):
# Accelerate the most common cases
if isinstance(data, types.StringType):
return data
- if typesHasUnicode:
- try: return data.encode('UTF8')
- except AttributeError: pass
+ try: return data.encode('UTF8')
+ except AttributeError: pass
return str(data)
def _dict_to_utf8(d):
# Convert the dictionary to have non-unocide key-value pairs
- if not typesHasUnicode:
- # Nothing to do
- return d
ret = {}
for k, v in d.items():
try: k = k.encode('UTF8')
commit 76c5af81470ae743f990d78cd722fc65d43bdfaa
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 14 11:34:14 2010 +0200
xml import optimization: 'key in dict' is 15% faster than 'dict.has_key(key)' and it's called 1000000 times during satellite-sync
diff --git a/backend/satellite_tools/xmlDiskDumper.py b/backend/satellite_tools/xmlDiskDumper.py
index c4d326b..2e9f323 100644
--- a/backend/satellite_tools/xmlDiskDumper.py
+++ b/backend/satellite_tools/xmlDiskDumper.py
@@ -257,7 +257,7 @@ class ShortPackageDumper(Dumper):
if self.compression:
filename = filename + '.gz'
- if diskfiles.has_key(filename):
+ if filename in diskfiles:
# The file is on the disk
del diskfiles[filename]
else:
diff --git a/backend/satellite_tools/xmlSource.py b/backend/satellite_tools/xmlSource.py
index a82d9cb..ef2d30f 100644
--- a/backend/satellite_tools/xmlSource.py
+++ b/backend/satellite_tools/xmlSource.py
@@ -168,7 +168,7 @@ class BaseDispatchHandler(ContentHandler, ErrorHandler):
self.container_dispatch[obj.container_name] = obj
def get_container(self, name):
- if not self.container_dispatch.has_key(name):
+ if name not in self.container_dispatch:
# Return a dummy container
c = ContainerHandler()
c.container_name = name
@@ -177,7 +177,7 @@ class BaseDispatchHandler(ContentHandler, ErrorHandler):
return self.container_dispatch[name]
def has_container(self, name):
- return self.container_dispatch.has_key(name)
+ return (name in self.container_dispatch)
# Overwrite the functions required by SAX
def setDocumentLocator(self, locator):
@@ -295,8 +295,8 @@ class BaseItem:
def populateFromAttributes(self, obj, sourceDict):
# Populates dict with items from sourceDict
for key, value in sourceDict.items():
- if not self.tagMap.has_key(key):
- if not obj.has_key(key):
+ if key not in self.tagMap:
+ if key not in obj:
# Unsupported key
continue
else:
@@ -322,10 +322,10 @@ class BaseItem:
obj[keys[0]] = element
continue
name = element.name
- if not obj.has_key(name) and not self.tagMap.has_key(name):
+ if name not in obj and name not in self.tagMap:
# Unsupported key
continue
- if self.tagMap.has_key(name):
+ if name in self.tagMap:
# Have to map this element
name = self.tagMap[name]
@@ -371,7 +371,7 @@ def addItem(classobj):
def _createItem(element):
# Creates an Item object from the specified element
- if not __itemDispatcher.has_key(element.name):
+ if element.name not in __itemDispatcher:
# No item processor
return None
item = __itemDispatcher[element.name]()
@@ -858,7 +858,7 @@ class ContainerHandler:
# Nothing to do with this object
return
- if item.has_key('error'):
+ if 'error' in item:
# Special case errors
log_debug(0, 'XML parser error: found "rhn-error" item: %s' %
item['error'])
14 years
2 commits - java/code
by Tomas Lestach
java/code/src/com/redhat/rhn/domain/server/ServerGroup.hbm.xml | 1
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 55 -------
java/code/src/com/redhat/rhn/frontend/xmlrpc/systemgroup/ServerGroupHandler.java | 51 ++++++
java/code/src/com/redhat/rhn/manager/errata/ErrataManager.java | 77 ++++++++++
4 files changed, 134 insertions(+), 50 deletions(-)
New commits:
commit ccfcba8ade7cf3e257bd6458eea7cb88ee187c2e
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri May 14 12:06:39 2010 +0200
588367 - introducing systemgroup.scheduleApplyErrataToActive API call
diff --git a/java/code/src/com/redhat/rhn/domain/server/ServerGroup.hbm.xml b/java/code/src/com/redhat/rhn/domain/server/ServerGroup.hbm.xml
index f1f6763..046ca4c 100644
--- a/java/code/src/com/redhat/rhn/domain/server/ServerGroup.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/server/ServerGroup.hbm.xml
@@ -167,6 +167,7 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
</query>
<sql-query name="ServerGroup.lookupActiveServerIds">
+ <return-scalar type="long" column="id"/>
<![CDATA[
SELECT S.id
FROM rhnServerGroupMembers SGM
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 212fd50..90d054d 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
@@ -2605,7 +2605,8 @@ public class SystemHandler extends BaseHandler {
* @xmlrpc.returntype #return_int_success()
*/
public int scheduleApplyErrata(String sessionKey, Integer sid, List errataIds) {
- ErrataManager.applyErrataHelper(getLoggedInUser(sessionKey), sid, errataIds, null);
+ ErrataManager.applyErrataHelper(getLoggedInUser(sessionKey), sid.longValue(),
+ errataIds, null);
return 1;
}
@@ -2625,10 +2626,10 @@ public class SystemHandler extends BaseHandler {
* @xmlrpc.param dateTime.iso8601 earliestOccurrence
* @xmlrpc.returntype #return_int_success()
*/
- public int scheduleApplyErrata(String sessionKey, Integer sid, List errataIds,
+ public int scheduleApplyErrata(String sessionKey, Integer sid, List errataIds,
Date earliestOccurrence) {
ErrataManager.applyErrataHelper(getLoggedInUser(sessionKey),
- sid, errataIds, earliestOccurrence);
+ sid.longValue(), errataIds, earliestOccurrence);
return 1;
}
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/systemgroup/ServerGroupHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/systemgroup/ServerGroupHandler.java
index 2abaec8..4d4f7c6 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/systemgroup/ServerGroupHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/systemgroup/ServerGroupHandler.java
@@ -30,9 +30,11 @@ import com.redhat.rhn.frontend.xmlrpc.LookupServerGroupException;
import com.redhat.rhn.frontend.xmlrpc.ServerGroupAccessChangeException;
import com.redhat.rhn.frontend.xmlrpc.ServerNotInGroupException;
import com.redhat.rhn.frontend.xmlrpc.system.XmlRpcSystemHelper;
+import com.redhat.rhn.manager.errata.ErrataManager;
import com.redhat.rhn.manager.system.ServerGroupManager;
import java.util.ArrayList;
+import java.util.Date;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
@@ -410,11 +412,14 @@ public class ServerGroupHandler extends BaseHandler {
*/
public List<Long> listActiveSystemsInGroup(String sessionKey, String systemGroupName) {
User loggedInUser = getLoggedInUser(sessionKey);
+ return activeSystemsInGroup(loggedInUser, systemGroupName);
+ }
+
+ private List<Long> activeSystemsInGroup(User loggedInUser, String systemGroupName) {
ServerGroup sg = lookup(systemGroupName, loggedInUser);
Long threshold = new Long(Config.get().getInt(
ConfigDefaults.SYSTEM_CHECKIN_THRESHOLD));
return ServerGroupManager.getInstance().listActiveServers(sg, threshold);
-
}
/**
@@ -466,5 +471,49 @@ public class ServerGroupHandler extends BaseHandler {
return listInactiveSystemsInGroup(sessionKey, systemGroupName,
threshold.intValue());
}
+
+ /**
+ * Schedules an action to apply errata updates to active systems from a group.
+ * @param sessionKey The user's session key.
+ * @param systemGroupName the system group
+ * @param errataIds List of errata IDs to apply (as Integers)
+ * @return 1 if successful, exception thrown otherwise
+ *
+ * @xmlrpc.doc Schedules an action to apply errata updates to active systems
+ * from a group.
+ * @xmlrpc.param #param("string", "sessionKey")
+ * @xmlrpc.param #param("string", "systemGroupName")
+ * @xmlrpc.param #array_single("int", "errataId")
+ * @xmlrpc.returntype #return_int_success()
+ */
+ public int scheduleApplyErrataToActive(String sessionKey, String systemGroupName,
+ List errataIds) {
+ return scheduleApplyErrataToActive(sessionKey, systemGroupName, errataIds, null);
+ }
+ /**
+ * Schedules an action to apply errata updates to active systems from a group
+ * at a specified time.
+ * @param sessionKey The user's session key.
+ * @param systemGroupName the system group
+ * @param errataIds List of errata IDs to apply (as Integers)
+ * @param earliestOccurrence Earliest occurrence of the errata update
+ * @return 1 if successful, exception thrown otherwise
+ *
+ * @xmlrpc.doc Schedules an action to apply errata updates to active systems
+ * from a group at a given date/time.
+ * @xmlrpc.param #param("string", "sessionKey")
+ * @xmlrpc.param #param("string", "systemGroupName")
+ * @xmlrpc.param #array_single("int", "errataId")
+ * @xmlrpc.param dateTime.iso8601 earliestOccurrence
+ * @xmlrpc.returntype #return_int_success()
+ */
+ public int scheduleApplyErrataToActive(String sessionKey, String systemGroupName,
+ List<Integer> errataIds, Date earliestOccurrence) {
+ User loggedInUser = getLoggedInUser(sessionKey);
+ List<Long> systemIds = activeSystemsInGroup(loggedInUser, systemGroupName);
+ ErrataManager.applyErrataHelper(loggedInUser, systemIds, errataIds,
+ earliestOccurrence);
+ return 1;
+ }
}
diff --git a/java/code/src/com/redhat/rhn/manager/errata/ErrataManager.java b/java/code/src/com/redhat/rhn/manager/errata/ErrataManager.java
index 3f45dd9..a347040 100644
--- a/java/code/src/com/redhat/rhn/manager/errata/ErrataManager.java
+++ b/java/code/src/com/redhat/rhn/manager/errata/ErrataManager.java
@@ -1345,39 +1345,69 @@ public class ErrataManager extends BaseManager {
* @param errataIds List of errata IDs to apply (as Integers)
* @param earliestOccurrence Earliest occurrence of the errata update
*/
- public static void applyErrataHelper(User loggedInUser, Integer sid, List errataIds,
+ public static void applyErrataHelper(User loggedInUser, Long sid, List errataIds,
Date earliestOccurrence) {
Server server = SystemManager.lookupByIdAndUser(new Long(sid.longValue()),
loggedInUser);
+ // check whether the whole errata list applicable to the system
+ checkApplicableErrata(loggedInUser, errataIds, sid);
+ // apply it
+ applyErrata(loggedInUser, errataIds, earliestOccurrence, sid);
+ }
+
+ /**
+ * Apply errata updates to a system list at a specified time.
+ * @param loggedInUser The logged in user
+ * @param systemIds list of system IDs
+ * @param errataIds List of errata IDs to apply (as Integers)
+ * @param earliestOccurrence Earliest occurrence of the errata update
+ */
+ public static void applyErrataHelper(User loggedInUser, List<Long> systemIds,
+ List<Integer> errataIds, Date earliestOccurrence) {
+ // first check, whether the errata list is applicable to the whole system list
+ // if not, exception is thrown
+ for (Long sid : systemIds) {
+ checkApplicableErrata(loggedInUser, errataIds, sid);
+ }
+ // at this point all errata is applicable to all systems, so let's apply
+ for (Long sid : systemIds) {
+ applyErrata(loggedInUser, errataIds, earliestOccurrence, sid);
+ }
+ }
+ private static void checkApplicableErrata(User loggedInUser, List<Integer> errataIds,
+ Long serverId) {
// Check to make sure the given errata are applicable to and unscheduled for the
// system in question. This catches three scenarios, errata that don't apply to
// this system, are already scheduled, or don't exist in the first place.
// TODO: fail silently in some of these cases?
Set unscheduledErrataIds = new HashSet();
List unscheduledErrata = SystemManager.unscheduledErrata(loggedInUser,
- server.getId(), null);
+ serverId, null);
for (Iterator it = unscheduledErrata.iterator(); it.hasNext();) {
Errata e = (Errata)it.next();
- unscheduledErrataIds.add(new Integer(e.getId().intValue()));
+ unscheduledErrataIds.add(e.getId());
}
for (Iterator it = errataIds.iterator(); it.hasNext();) {
Integer currentId = (Integer)it.next();
- if (!unscheduledErrataIds.contains(currentId)) {
+ if (!unscheduledErrataIds.contains(currentId.longValue())) {
throw new InvalidErrataException();
}
}
-
- for (Iterator it = errataIds.iterator(); it.hasNext();) {
- Integer currentId = (Integer)it.next();
- Errata errata = ErrataManager.lookupErrata(new Long(currentId.longValue()),
- loggedInUser);
- Action update = ActionManager.createErrataAction(loggedInUser, errata);
- if (earliestOccurrence != null) {
- update.setEarliestAction(earliestOccurrence);
- }
- ActionManager.addServerToAction(server.getId(), update);
- ActionManager.storeAction(update);
- }
}
+
+ private static void applyErrata(User loggedInUser, List errataIds,
+ Date earliestOccurrence, Long serverId) {
+ for (Iterator it = errataIds.iterator(); it.hasNext();) {
+ Integer currentId = (Integer)it.next();
+ Errata errata = ErrataManager.lookupErrata(currentId.longValue(),
+ loggedInUser);
+ Action update = ActionManager.createErrataAction(loggedInUser, errata);
+ if (earliestOccurrence != null) {
+ update.setEarliestAction(earliestOccurrence);
+ }
+ ActionManager.addServerToAction(serverId, update);
+ ActionManager.storeAction(update);
+ }
+ }
}
commit 388a9248a06e9bc21f41af50b353416d6c0c1748
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu May 13 11:44:11 2010 +0200
588367 move applyErrataHelper to ErrataManager
to share the method
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 9c3ae09..212fd50 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
@@ -79,7 +79,6 @@ import com.redhat.rhn.frontend.xmlrpc.InvalidActionTypeException;
import com.redhat.rhn.frontend.xmlrpc.InvalidChannelLabelException;
import com.redhat.rhn.frontend.xmlrpc.InvalidChannelListException;
import com.redhat.rhn.frontend.xmlrpc.InvalidEntitlementException;
-import com.redhat.rhn.frontend.xmlrpc.InvalidErrataException;
import com.redhat.rhn.frontend.xmlrpc.InvalidPackageException;
import com.redhat.rhn.frontend.xmlrpc.InvalidProfileLabelException;
import com.redhat.rhn.frontend.xmlrpc.InvalidSystemException;
@@ -2606,7 +2605,7 @@ public class SystemHandler extends BaseHandler {
* @xmlrpc.returntype #return_int_success()
*/
public int scheduleApplyErrata(String sessionKey, Integer sid, List errataIds) {
- applyErrataHelper(sessionKey, sid, errataIds, null);
+ ErrataManager.applyErrataHelper(getLoggedInUser(sessionKey), sid, errataIds, null);
return 1;
}
@@ -2628,54 +2627,11 @@ public class SystemHandler extends BaseHandler {
*/
public int scheduleApplyErrata(String sessionKey, Integer sid, List errataIds,
Date earliestOccurrence) {
- applyErrataHelper(sessionKey, sid, errataIds, earliestOccurrence);
+ ErrataManager.applyErrataHelper(getLoggedInUser(sessionKey),
+ sid, errataIds, earliestOccurrence);
return 1;
}
-
- /**
- * Apply errata updates to a system at a specified time.
- * @param sessionKey The user's session key.
- * @param sid ID of the server
- * @param errataIds List of errata IDs to apply (as Integers)
- * @param earliestOccurrence Earliest occurrence of the errata update
- */
- private void applyErrataHelper(String sessionKey, Integer sid, List errataIds,
- Date earliestOccurrence) {
- User loggedInUser = getLoggedInUser(sessionKey);
- Server server = SystemManager.lookupByIdAndUser(new Long(sid.longValue()),
- loggedInUser);
-
- // Check to make sure the given errata are applicable to and unscheduled for the
- // system in question. This catches three scenarios, errata that don't apply to
- // this system, are already scheduled, or don't exist in the first place.
- // TODO: fail silently in some of these cases?
- Set unscheduledErrataIds = new HashSet();
- List unscheduledErrata = SystemManager.unscheduledErrata(loggedInUser,
- server.getId(), null);
- for (Iterator it = unscheduledErrata.iterator(); it.hasNext();) {
- Errata e = (Errata)it.next();
- unscheduledErrataIds.add(new Integer(e.getId().intValue()));
- }
- for (Iterator it = errataIds.iterator(); it.hasNext();) {
- Integer currentId = (Integer)it.next();
- if (!unscheduledErrataIds.contains(currentId)) {
- throw new InvalidErrataException();
- }
- }
-
- for (Iterator it = errataIds.iterator(); it.hasNext();) {
- Integer currentId = (Integer)it.next();
- Errata errata = ErrataManager.lookupErrata(new Long(currentId.longValue()),
- loggedInUser);
- Action update = ActionManager.createErrataAction(loggedInUser, errata);
- if (earliestOccurrence != null) {
- update.setEarliestAction(earliestOccurrence);
- }
- ActionManager.addServerToAction(server.getId(), update);
- ActionManager.storeAction(update);
- }
- }
-
+
/**
* Compares the packages installed on two systems.
*
diff --git a/java/code/src/com/redhat/rhn/manager/errata/ErrataManager.java b/java/code/src/com/redhat/rhn/manager/errata/ErrataManager.java
index a7ebfde..3f45dd9 100644
--- a/java/code/src/com/redhat/rhn/manager/errata/ErrataManager.java
+++ b/java/code/src/com/redhat/rhn/manager/errata/ErrataManager.java
@@ -25,6 +25,7 @@ import com.redhat.rhn.common.hibernate.LookupException;
import com.redhat.rhn.common.localization.LocalizationService;
import com.redhat.rhn.common.messaging.MessageQueue;
import com.redhat.rhn.common.security.PermissionException;
+import com.redhat.rhn.domain.action.Action;
import com.redhat.rhn.domain.channel.Channel;
import com.redhat.rhn.domain.channel.ChannelFactory;
import com.redhat.rhn.domain.errata.Bug;
@@ -36,6 +37,7 @@ import com.redhat.rhn.domain.errata.impl.PublishedClonedErrata;
import com.redhat.rhn.domain.org.Org;
import com.redhat.rhn.domain.rhnset.RhnSet;
import com.redhat.rhn.domain.role.RoleFactory;
+import com.redhat.rhn.domain.server.Server;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.frontend.dto.ChannelOverview;
import com.redhat.rhn.frontend.dto.ErrataOverview;
@@ -44,11 +46,14 @@ import com.redhat.rhn.frontend.dto.PackageOverview;
import com.redhat.rhn.frontend.events.CloneErrataAction;
import com.redhat.rhn.frontend.events.CloneErrataEvent;
import com.redhat.rhn.frontend.listview.PageControl;
+import com.redhat.rhn.frontend.xmlrpc.InvalidErrataException;
import com.redhat.rhn.manager.BaseManager;
+import com.redhat.rhn.manager.action.ActionManager;
import com.redhat.rhn.manager.channel.ChannelManager;
import com.redhat.rhn.manager.errata.cache.ErrataCacheManager;
import com.redhat.rhn.manager.rhnset.RhnSetDecl;
import com.redhat.rhn.manager.rhnset.RhnSetManager;
+import com.redhat.rhn.manager.system.SystemManager;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
@@ -59,6 +64,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
@@ -1332,5 +1338,46 @@ public class ErrataManager extends BaseManager {
ErrataFactory.syncErrataDetails(cloned);
}
+ /**
+ * Apply errata updates to a system at a specified time.
+ * @param loggedInUser The logged in user
+ * @param sid ID of the server
+ * @param errataIds List of errata IDs to apply (as Integers)
+ * @param earliestOccurrence Earliest occurrence of the errata update
+ */
+ public static void applyErrataHelper(User loggedInUser, Integer sid, List errataIds,
+ Date earliestOccurrence) {
+ Server server = SystemManager.lookupByIdAndUser(new Long(sid.longValue()),
+ loggedInUser);
+ // Check to make sure the given errata are applicable to and unscheduled for the
+ // system in question. This catches three scenarios, errata that don't apply to
+ // this system, are already scheduled, or don't exist in the first place.
+ // TODO: fail silently in some of these cases?
+ Set unscheduledErrataIds = new HashSet();
+ List unscheduledErrata = SystemManager.unscheduledErrata(loggedInUser,
+ server.getId(), null);
+ for (Iterator it = unscheduledErrata.iterator(); it.hasNext();) {
+ Errata e = (Errata)it.next();
+ unscheduledErrataIds.add(new Integer(e.getId().intValue()));
+ }
+ for (Iterator it = errataIds.iterator(); it.hasNext();) {
+ Integer currentId = (Integer)it.next();
+ if (!unscheduledErrataIds.contains(currentId)) {
+ throw new InvalidErrataException();
+ }
+ }
+
+ for (Iterator it = errataIds.iterator(); it.hasNext();) {
+ Integer currentId = (Integer)it.next();
+ Errata errata = ErrataManager.lookupErrata(new Long(currentId.longValue()),
+ loggedInUser);
+ Action update = ActionManager.createErrataAction(loggedInUser, errata);
+ if (earliestOccurrence != null) {
+ update.setEarliestAction(earliestOccurrence);
+ }
+ ActionManager.addServerToAction(server.getId(), update);
+ ActionManager.storeAction(update);
+ }
+ }
}
14 years
client/rhel
by Transifex System User
client/rhel/yum-rhn-plugin/po/ru.po | 39 ++++++++++++++++++------------------
1 file changed, 20 insertions(+), 19 deletions(-)
New commits:
commit 431121654948136106530e5e4c3a8eae8085fd5b
Author: ypoyarko <ypoyarko(a)fedoraproject.org>
Date: Thu May 13 23:47:18 2010 +0000
l10n: Updates to Russian (ru) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
diff --git a/client/rhel/yum-rhn-plugin/po/ru.po b/client/rhel/yum-rhn-plugin/po/ru.po
index b65b62e..7d14e94 100644
--- a/client/rhel/yum-rhn-plugin/po/ru.po
+++ b/client/rhel/yum-rhn-plugin/po/ru.po
@@ -1,25 +1,26 @@
-# translation of ru.po to
+# translation of ru.po to
# translation of ru.po to
# This file is distributed under the same license as the PACKAGE package.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER.
-# Yulia Poyarkova <ypoyarko(a)redhat.com>, 2006.
#
+# Yulia <ypoyarko(a)redhat.com>, 2006, 2010.
msgid ""
msgstr ""
"Project-Id-Version: ru\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-05-06 16:28+0200\n"
-"PO-Revision-Date: 2006-11-29 09:24+1000\n"
-"Last-Translator: Yulia Poyarkova <ypoyarko(a)redhat.com>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-05-14 09:01\n"
+"Last-Translator: Yulia <ypoyarko(a)redhat.com>\n"
+"Language-Team: Russian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.9.1\n"
+"X-Generator: KBabel 1.11.4\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: ../rhnplugin.py:47
msgid "There was an error communicating with RHN."
-msgstr "Ошибка обращения к RHN."
+msgstr "Ошибка при обращении к RHN."
#: ../rhnplugin.py:69
msgid "RHN support will be disabled."
@@ -30,23 +31,23 @@ msgstr "Поддержка RHN будет отключена."
msgid ""
"*Note* Red Hat Network repositories are not listed below. You must run this "
"command as root to access RHN repositories."
-msgstr ""
+msgstr "*Примечание* Этот список не содержит репозитории Red Hat Network. Чтобы получить к ним доступ, выполните эту команду в режиме root."
#: ../rhnplugin.py:95
msgid "There was an error parsing the RHN proxy settings."
-msgstr "Ошибка обработки установок RHN proxy."
+msgstr "Ошибка при обработке настроек RHN proxy."
#: ../rhnplugin.py:106
msgid "Cleaning"
-msgstr ""
+msgstr "Очистка"
#: ../rhnplugin.py:112
msgid "Either --version, or no commands entered"
-msgstr "Не задана версия или команды"
+msgstr "Не указан ключ --version или не заданы команды"
#: ../rhnplugin.py:126
msgid "This system is not registered with RHN."
-msgstr "Данная система не зарегистрирована в RHN."
+msgstr "Эта система не зарегистрирована в RHN."
#: ../rhnplugin.py:131
msgid "RHN channel support will be disabled."
@@ -54,29 +55,29 @@ msgstr "Поддержка каналов RHN будет отключена."
#: ../rhnplugin.py:135
msgid "This system is not subscribed to any channels."
-msgstr "Данная система не имеет подписки на каналы."
+msgstr "Эта система не подписана на каналы."
#: ../rhnplugin.py:139
-msgid ""
-"This system may not be a registered to RHN. SystemId could not be acquired.\n"
-msgstr ""
+msgid "This system may not be a registered to RHN. SystemId could not be acquired.\n"
+msgstr "Возможно, эта система не зарегистрирована в RHN. Не удалось получить SystemID.\n"
#: ../rhnplugin.py:213
msgid "Package profile information could not be sent."
-msgstr "Информация о профиле пакета не будет отправлена."
+msgstr "Не удалось отправить информацию о профиле пакета."
#. This is compensating for hosted/satellite returning back an error
#. message instructing RHEL5 clients to run "up2date --register"
#. bz: 438175
#: ../rhnplugin.py:220
msgid "Error Message:"
-msgstr ""
+msgstr "Сообщение:"
#: ../rhnplugin.py:221
msgid "Please run rhn_register as root on this client"
-msgstr ""
+msgstr "Выполните rhn_register в режиме root на этом клиенте"
#: ../rhnplugin.py:298
#, python-format
msgid "Missing required login information for RHN: %s"
msgstr "Отсутствует необходимая информация для входа в RHN: %s"
+
14 years