3 commits - java/code java/spacewalk-java.spec rel-eng/packages
by Jan Dobes
java/code/src/com/redhat/rhn/common/util/StringUtil.java | 46 +++++++++++----
java/spacewalk-java.spec | 6 +
rel-eng/packages/spacewalk-java | 2
3 files changed, 41 insertions(+), 13 deletions(-)
New commits:
commit eec889d85accfcd9bccc6a9dd40d217e991275b3
Author: Jan Dobes <jdobes(a)redhat.com>
Date: Thu Apr 4 13:26:18 2013 +0200
Automatic commit of package [spacewalk-java] release [1.10.41-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index 1c19bfc..c4f9ed2 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -28,7 +28,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.10.40
+Version: 1.10.41
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -678,6 +678,10 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Thu Apr 04 2013 Jan Dobes 1.10.41-1
+- checkstyle fix
+- 928198 - fixing URL detection to not contain dot or comma at the end.
+
* Wed Apr 03 2013 Stephen Herr <sherr(a)redhat.com> 1.10.40-1
- Display number of sockets in system details and spacewalk-reports
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 7c5c774..1a2658a 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.10.40-1 java/
+1.10.41-1 java/
commit 1dd7cbd1ade1b8c9ccbc8dee7b12bb8a1eeefa1d
Author: Jan Dobes <jdobes(a)redhat.com>
Date: Thu Apr 4 12:40:17 2013 +0200
checkstyle fix
diff --git a/java/code/src/com/redhat/rhn/common/util/StringUtil.java b/java/code/src/com/redhat/rhn/common/util/StringUtil.java
index 94ac2ea..6a5d8d9 100644
--- a/java/code/src/com/redhat/rhn/common/util/StringUtil.java
+++ b/java/code/src/com/redhat/rhn/common/util/StringUtil.java
@@ -15,18 +15,7 @@
package com.redhat.rhn.common.util;
-import com.redhat.rhn.common.localization.LocalizationService;
-import com.redhat.rhn.common.validator.ValidatorException;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
-import org.apache.xml.utils.XMLChar;
-import org.stringtree.json.JSONReader;
-import org.stringtree.json.JSONWriter;
-
import java.net.URLEncoder;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
@@ -40,6 +29,16 @@ import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.apache.xml.utils.XMLChar;
+import org.stringtree.json.JSONReader;
+import org.stringtree.json.JSONWriter;
+
+import com.redhat.rhn.common.localization.LocalizationService;
+import com.redhat.rhn.common.validator.ValidatorException;
+
/**
* A simple class that assists with String manipulation
* @version $Rev$
@@ -398,7 +397,7 @@ public class StringUtil {
int line = entireToken.indexOf("<br/>");
int tag = entireToken.indexOf("<");
int end = -1;
-
+
// end characters
Set<Character> endChars = new HashSet<Character>();
endChars.add(new Character('.'));
@@ -414,10 +413,10 @@ public class StringUtil {
if (end == -1 || (end > tag && tag != -1)) {
end = tag;
}
-
+
// dot before the end
if (end > 0 && (endChars.contains(
- new Character(entireToken.charAt(end-1))))) {
+ new Character(entireToken.charAt(end - 1))))) {
end--;
}
// dot at the end
@@ -425,7 +424,7 @@ public class StringUtil {
new Character(entireToken.charAt(entireToken.length() - 1)))) {
end = entireToken.length() - 1;
}
-
+
return end;
}
commit f7f29935ceee60501d183f10f49302e9cc9d4812
Author: Jan Dobes <jdobes(a)redhat.com>
Date: Thu Apr 4 12:18:26 2013 +0200
928198 - fixing URL detection to not contain dot or comma at the end.
diff --git a/java/code/src/com/redhat/rhn/common/util/StringUtil.java b/java/code/src/com/redhat/rhn/common/util/StringUtil.java
index a7c3b3b..94ac2ea 100644
--- a/java/code/src/com/redhat/rhn/common/util/StringUtil.java
+++ b/java/code/src/com/redhat/rhn/common/util/StringUtil.java
@@ -26,13 +26,16 @@ import org.stringtree.json.JSONReader;
import org.stringtree.json.JSONWriter;
import java.net.URLEncoder;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Random;
+import java.util.Set;
import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -385,11 +388,21 @@ public class StringUtil {
return ret.toString();
}
+ /**
+ * Finds end of URL.
+ * @param entireToken input String (URL)
+ * @return position of last char of URL, returns -1 when entire String is URL
+ */
private static int findEndOfUrl(String entireToken) {
int space = entireToken.indexOf(" ");
int line = entireToken.indexOf("<br/>");
int tag = entireToken.indexOf("<");
int end = -1;
+
+ // end characters
+ Set<Character> endChars = new HashSet<Character>();
+ endChars.add(new Character('.'));
+ endChars.add(new Character(','));
if (space == -1 || (space > line && line != -1)) {
end = line;
@@ -399,8 +412,20 @@ public class StringUtil {
}
if (end == -1 || (end > tag && tag != -1)) {
- return tag;
+ end = tag;
+ }
+
+ // dot before the end
+ if (end > 0 && (endChars.contains(
+ new Character(entireToken.charAt(end-1))))) {
+ end--;
+ }
+ // dot at the end
+ else if (endChars.contains(
+ new Character(entireToken.charAt(entireToken.length() - 1)))) {
+ end = entireToken.length() - 1;
}
+
return end;
}
11 years, 1 month
Changes to 'refs/tags/spacewalk-schema-1.10.21-1'
by StephenHerr
Tag 'spacewalk-schema-1.10.21-1' created by Stephen Herr <sherr(a)redhat.com> at 2013-04-03 21:09 +0000
Tagging package [spacewalk-schema] version [1.10.21-1] in directory [schema/spacewalk/].
Changes since spacewalk-schema-1.10.20-1:
Stephen Herr (2):
renaming file to correct suffix
Automatic commit of package [spacewalk-schema] release [1.10.21-1].
---
rel-eng/packages/spacewalk-schema | 2
schema/spacewalk/spacewalk-schema.spec | 5 +
schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.postgres | 37 ----------
schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.postgresql | 37 ++++++++++
4 files changed, 42 insertions(+), 39 deletions(-)
---
11 years, 1 month
2 commits - rel-eng/packages schema/spacewalk
by StephenHerr
rel-eng/packages/spacewalk-schema | 2
schema/spacewalk/spacewalk-schema.spec | 5 +
schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.postgres | 37 ----------
schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.postgresql | 37 ++++++++++
4 files changed, 42 insertions(+), 39 deletions(-)
New commits:
commit 905d5810bddc36f8c22e5a0eb227fe24ff5fd3cf
Author: Stephen Herr <sherr(a)redhat.com>
Date: Wed Apr 3 17:09:13 2013 -0400
Automatic commit of package [spacewalk-schema] release [1.10.21-1].
diff --git a/rel-eng/packages/spacewalk-schema b/rel-eng/packages/spacewalk-schema
index b17cdcc..17f22ce 100644
--- a/rel-eng/packages/spacewalk-schema
+++ b/rel-eng/packages/spacewalk-schema
@@ -1 +1 @@
-1.10.20-1 schema/spacewalk/
+1.10.21-1 schema/spacewalk/
diff --git a/schema/spacewalk/spacewalk-schema.spec b/schema/spacewalk/spacewalk-schema.spec
index a7429c9..3153c35 100644
--- a/schema/spacewalk/spacewalk-schema.spec
+++ b/schema/spacewalk/spacewalk-schema.spec
@@ -4,7 +4,7 @@ Name: spacewalk-schema
Group: Applications/Internet
Summary: Oracle SQL schema for Spacewalk server
-Version: 1.10.20
+Version: 1.10.21
Release: 1%{?dist}
Source0: %{name}-%{version}.tar.gz
@@ -71,6 +71,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/spacewalk-sql*
%changelog
+* Wed Apr 03 2013 Stephen Herr <sherr(a)redhat.com> 1.10.21-1
+- renaming file to correct suffix
+
* Wed Apr 03 2013 Stephen Herr <sherr(a)redhat.com> 1.10.20-1
- Display number of sockets in system details and spacewalk-reports
commit ef063db763e503e89ee3e376b2d98c2f0ced69f8
Author: Stephen Herr <sherr(a)redhat.com>
Date: Wed Apr 3 17:08:59 2013 -0400
renaming file to correct suffix
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.postgres b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.postgres
deleted file mode 100644
index f333791..0000000
--- a/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.postgres
+++ /dev/null
@@ -1,37 +0,0 @@
--- oracle equivalent source sha1 66f568e1f6d397f23d2afd412ea60541db81150c
-
-create or replace function get_hw_info_as_clob(
- sid in rhnserver.id%TYPE,
- separator in varchar
-)
-returns text
-as
-$$
-declare
- ret text;
- rec record;
-begin
- for rec in (
- select m
- from (
- select 1 n, sum(nrcpu) || ' CPUs ' || coalesce(to_char(sum(nrsocket), 'FM999'), 'unknown') || ' Sockets' m
- from rhncpu where rhncpu.server_id = sid
- union all
- select 2, ni.name||' '||coalesce(na4.address,'')||'/'||coalesce(na4.netmask,'')||' '||ni.hw_addr val
- from rhnservernetinterface ni,
- rhnServerNetAddress4 na4
- where ni.server_id = sid
- and ni.id = na4.interface_id
- ) X
- order by n, m
- ) loop
- if ret is null then
- ret := rec.m;
- else
- ret := ret || separator || rec.m;
- end if;
- end loop;
- return ret;
-end;
-$$ language plpgsql;
-
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.postgresql b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.postgresql
new file mode 100644
index 0000000..f333791
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.postgresql
@@ -0,0 +1,37 @@
+-- oracle equivalent source sha1 66f568e1f6d397f23d2afd412ea60541db81150c
+
+create or replace function get_hw_info_as_clob(
+ sid in rhnserver.id%TYPE,
+ separator in varchar
+)
+returns text
+as
+$$
+declare
+ ret text;
+ rec record;
+begin
+ for rec in (
+ select m
+ from (
+ select 1 n, sum(nrcpu) || ' CPUs ' || coalesce(to_char(sum(nrsocket), 'FM999'), 'unknown') || ' Sockets' m
+ from rhncpu where rhncpu.server_id = sid
+ union all
+ select 2, ni.name||' '||coalesce(na4.address,'')||'/'||coalesce(na4.netmask,'')||' '||ni.hw_addr val
+ from rhnservernetinterface ni,
+ rhnServerNetAddress4 na4
+ where ni.server_id = sid
+ and ni.id = na4.interface_id
+ ) X
+ order by n, m
+ ) loop
+ if ret is null then
+ ret := rec.m;
+ else
+ ret := ret || separator || rec.m;
+ end if;
+ end loop;
+ return ret;
+end;
+$$ language plpgsql;
+
11 years, 1 month
Changes to 'refs/tags/spacewalk-schema-1.10.20-1'
by StephenHerr
Tag 'spacewalk-schema-1.10.20-1' created by Stephen Herr <sherr(a)redhat.com> at 2013-04-03 20:45 +0000
Tagging package [spacewalk-schema] version [1.10.20-1] in directory [schema/spacewalk/].
Changes since spacewalk-java-1.10.40-1:
Stephen Herr (1):
Automatic commit of package [spacewalk-schema] release [1.10.20-1].
---
rel-eng/packages/spacewalk-schema | 2 +-
schema/spacewalk/spacewalk-schema.spec | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
---
11 years, 1 month
Changes to 'refs/tags/spacewalk-java-1.10.40-1'
by StephenHerr
Tag 'spacewalk-java-1.10.40-1' created by Stephen Herr <sherr(a)redhat.com> at 2013-04-03 20:45 +0000
Tagging package [spacewalk-java] version [1.10.40-1] in directory [java/].
Changes since yum-rhn-plugin-1.10.1-1:
Stephen Herr (2):
Display number of sockets in system details and spacewalk-reports
Automatic commit of package [spacewalk-java] release [1.10.40-1].
---
java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java | 36 +++++----
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 12 +++
java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp | 30 +++++---
java/spacewalk-java.spec | 5 +
rel-eng/packages/spacewalk-java | 2
schema/spacewalk/oracle/procs/get_hw_info_as_clob.sql | 2
schema/spacewalk/postgres/procs/get_hw_info_as_clob.sql | 4 -
schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.oracle | 34 +++++++++
schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.postgres | 37 ++++++++++
9 files changed, 130 insertions(+), 32 deletions(-)
---
11 years, 1 month
3 commits - java/code java/spacewalk-java.spec rel-eng/packages schema/spacewalk
by StephenHerr
java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java | 36 +++++----
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 12 +++
java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp | 30 +++++---
java/spacewalk-java.spec | 5 +
rel-eng/packages/spacewalk-java | 2
rel-eng/packages/spacewalk-schema | 2
schema/spacewalk/oracle/procs/get_hw_info_as_clob.sql | 2
schema/spacewalk/postgres/procs/get_hw_info_as_clob.sql | 4 -
schema/spacewalk/spacewalk-schema.spec | 5 +
schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.oracle | 34 +++++++++
schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.postgres | 37 ++++++++++
11 files changed, 135 insertions(+), 34 deletions(-)
New commits:
commit ccc536f59e8af2fc15c081d4ef65642054285950
Author: Stephen Herr <sherr(a)redhat.com>
Date: Wed Apr 3 16:45:43 2013 -0400
Automatic commit of package [spacewalk-schema] release [1.10.20-1].
diff --git a/rel-eng/packages/spacewalk-schema b/rel-eng/packages/spacewalk-schema
index a1379ef..b17cdcc 100644
--- a/rel-eng/packages/spacewalk-schema
+++ b/rel-eng/packages/spacewalk-schema
@@ -1 +1 @@
-1.10.19-1 schema/spacewalk/
+1.10.20-1 schema/spacewalk/
diff --git a/schema/spacewalk/spacewalk-schema.spec b/schema/spacewalk/spacewalk-schema.spec
index 6709df0..a7429c9 100644
--- a/schema/spacewalk/spacewalk-schema.spec
+++ b/schema/spacewalk/spacewalk-schema.spec
@@ -4,7 +4,7 @@ Name: spacewalk-schema
Group: Applications/Internet
Summary: Oracle SQL schema for Spacewalk server
-Version: 1.10.19
+Version: 1.10.20
Release: 1%{?dist}
Source0: %{name}-%{version}.tar.gz
@@ -71,6 +71,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/spacewalk-sql*
%changelog
+* Wed Apr 03 2013 Stephen Herr <sherr(a)redhat.com> 1.10.20-1
+- Display number of sockets in system details and spacewalk-reports
+
* Thu Mar 28 2013 Jan Pazdziora 1.10.19-1
- Fixing type in schema upgrade.
commit c784ad34baa46ac95a553d070ce3e83d59eb03d1
Author: Stephen Herr <sherr(a)redhat.com>
Date: Wed Apr 3 16:45:30 2013 -0400
Automatic commit of package [spacewalk-java] release [1.10.40-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index 98e4edd..1c19bfc 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -28,7 +28,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.10.39
+Version: 1.10.40
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -678,6 +678,9 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Wed Apr 03 2013 Stephen Herr <sherr(a)redhat.com> 1.10.40-1
+- Display number of sockets in system details and spacewalk-reports
+
* Wed Apr 03 2013 Tomas Lestach <tlestach(a)redhat.com> 1.10.39-1
- 904072 - fix 'Configs' column on system groups related pages
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 182ce74..7c5c774 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.10.39-1 java/
+1.10.40-1 java/
commit 65b8c9413c7ef714296233003a2b58c18b069a91
Author: Stephen Herr <sherr(a)redhat.com>
Date: Wed Apr 3 16:45:22 2013 -0400
Display number of sockets in system details and spacewalk-reports
diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java b/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java
index 06efa0d..2dba582 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java
@@ -14,6 +14,23 @@
*/
package com.redhat.rhn.frontend.action.systems.sdc;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.DynaActionForm;
+
import com.redhat.rhn.domain.action.Action;
import com.redhat.rhn.domain.action.ActionFactory;
import com.redhat.rhn.domain.server.CPU;
@@ -30,23 +47,6 @@ import com.redhat.rhn.frontend.taglibs.list.ListTagHelper;
import com.redhat.rhn.manager.action.ActionManager;
import com.redhat.rhn.manager.system.SystemManager;
-import org.apache.commons.lang.StringUtils;
-import org.apache.struts.action.ActionForm;
-import org.apache.struts.action.ActionForward;
-import org.apache.struts.action.ActionMapping;
-import org.apache.struts.action.DynaActionForm;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
/**
* SystemHardwareAction handles the interaction of the ChannelDetails page.
* @version $Rev$
@@ -120,6 +120,8 @@ public class SystemHardwareAction extends RhnAction {
request.setAttribute("cpu_family", cpu.getFamily());
request.setAttribute("cpu_arch", server.getServerArch().getName());
request.setAttribute("cpu_cache", cpu.getCache());
+ request.setAttribute("cpu_sockets", cpu.getNrsocket());
+ request.setAttribute("cpu_cores", cpu.getNrCPU());
}
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
index 930a5ca..24d879a 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
@@ -16811,6 +16811,18 @@ The Tree Path, Kickstart RPM, Base Channel, and Installer Generation should alwa
<context context-type="sourcefile">/systems/details/SystemHardware.do</context>
</context-group>
</trans-unit>
+ <trans-unit id="sdc.details.hardware.sockets">
+ <source>Sockets:</source>
+ <context-group name="ctx">
+ <context context-type="sourcefile">/systems/details/SystemHardware.do</context>
+ </context-group>
+ </trans-unit>
+ <trans-unit id="sdc.details.hardware.cores">
+ <source>Cores:</source>
+ <context-group name="ctx">
+ <context context-type="sourcefile">/systems/details/SystemHardware.do</context>
+ </context-group>
+ </trans-unit>
<trans-unit id="sdc.details.hardware.cache">
<source>Cache:</source>
<context-group name="ctx">
diff --git a/java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp b/java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp
index f57834e..bf6d4f6 100644
--- a/java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp
@@ -36,6 +36,12 @@
${cpu_arch}
</td>
<th>
+ <bean:message key="sdc.details.hardware.sockets"/>
+ </th>
+ <td>
+ ${cpu_sockets}
+ </td>
+ <th>
<bean:message key="sdc.details.hardware.cache"/>
</th>
<td>
@@ -49,19 +55,17 @@
<td>
${cpu_vendor}
</td>
- <th rowspan="2">
- <bean:message key="sdc.details.hardware.memory"/>
+ <th>
+ <bean:message key="sdc.details.hardware.cores"/>
</th>
- <td rowspan="2">
- ${system_ram} MB
+ <td>
+ ${cpu_cores}
</td>
- </tr>
- <tr>
<th>
- <bean:message key="sdc.details.hardware.stepping"/>
+ <bean:message key="sdc.details.hardware.memory"/>
</th>
<td>
- ${cpu_stepping}
+ ${system_ram} MB
</td>
</tr>
<tr>
@@ -71,10 +75,16 @@
<td>
${cpu_family}
</td>
- <th rowspan="2">
+ <th>
+ <bean:message key="sdc.details.hardware.stepping"/>
+ </th>
+ <td>
+ ${cpu_stepping}
+ </td>
+ <th>
<bean:message key="sdc.details.hardware.swap"/>
</th>
- <td rowspan="2">
+ <td>
${system_swap} MB
</td>
</tr>
diff --git a/schema/spacewalk/oracle/procs/get_hw_info_as_clob.sql b/schema/spacewalk/oracle/procs/get_hw_info_as_clob.sql
index d6fea07..b5a2bc2 100644
--- a/schema/spacewalk/oracle/procs/get_hw_info_as_clob.sql
+++ b/schema/spacewalk/oracle/procs/get_hw_info_as_clob.sql
@@ -12,7 +12,7 @@ begin
for rec in (
select m
from (
- select 1 n, sum(nrcpu) || ' CPUs' m
+ select 1 n, sum(nrcpu) || ' CPUs ' || coalesce(to_char(sum(nrsocket)), 'unknown') || ' Sockets' m
from rhncpu where rhncpu.server_id = sid
union all
select 2, ni.name||' '||na4.address||'/'||na4.netmask||' '||ni.hw_addr val
diff --git a/schema/spacewalk/postgres/procs/get_hw_info_as_clob.sql b/schema/spacewalk/postgres/procs/get_hw_info_as_clob.sql
index 23549d3..f333791 100644
--- a/schema/spacewalk/postgres/procs/get_hw_info_as_clob.sql
+++ b/schema/spacewalk/postgres/procs/get_hw_info_as_clob.sql
@@ -1,4 +1,4 @@
--- oracle equivalent source sha1 6a538f3b05d412810baec118fbb7860348c60cd4
+-- oracle equivalent source sha1 66f568e1f6d397f23d2afd412ea60541db81150c
create or replace function get_hw_info_as_clob(
sid in rhnserver.id%TYPE,
@@ -14,7 +14,7 @@ begin
for rec in (
select m
from (
- select 1 n, sum(nrcpu) || ' CPUs' m
+ select 1 n, sum(nrcpu) || ' CPUs ' || coalesce(to_char(sum(nrsocket), 'FM999'), 'unknown') || ' Sockets' m
from rhncpu where rhncpu.server_id = sid
union all
select 2, ni.name||' '||coalesce(na4.address,'')||'/'||coalesce(na4.netmask,'')||' '||ni.hw_addr val
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.oracle b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.oracle
new file mode 100644
index 0000000..b5a2bc2
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.oracle
@@ -0,0 +1,34 @@
+
+create or replace function get_hw_info_as_clob(
+ sid in rhnserver.id%TYPE,
+ separator in varchar
+)
+return clob
+is
+ ret clob;
+ tmp varchar2(4000);
+begin
+ dbms_lob.createtemporary(ret, true);
+ for rec in (
+ select m
+ from (
+ select 1 n, sum(nrcpu) || ' CPUs ' || coalesce(to_char(sum(nrsocket)), 'unknown') || ' Sockets' m
+ from rhncpu where rhncpu.server_id = sid
+ union all
+ select 2, ni.name||' '||na4.address||'/'||na4.netmask||' '||ni.hw_addr val
+ from rhnservernetinterface ni,
+ rhnServerNetAddress4 na4
+ where ni.server_id = sid
+ and ni.id = na4.interface_id
+ )
+ order by n, m
+ ) loop
+ if dbms_lob.getlength(ret) > 0 then
+ dbms_lob.writeappend(ret, length(separator), separator);
+ end if;
+ dbms_lob.writeappend(ret, length(rec.m), rec.m);
+ end loop;
+ return ret;
+end;
+/
+
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.postgres b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.postgres
new file mode 100644
index 0000000..f333791
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/013-get_hw_info_as_clob.sql.postgres
@@ -0,0 +1,37 @@
+-- oracle equivalent source sha1 66f568e1f6d397f23d2afd412ea60541db81150c
+
+create or replace function get_hw_info_as_clob(
+ sid in rhnserver.id%TYPE,
+ separator in varchar
+)
+returns text
+as
+$$
+declare
+ ret text;
+ rec record;
+begin
+ for rec in (
+ select m
+ from (
+ select 1 n, sum(nrcpu) || ' CPUs ' || coalesce(to_char(sum(nrsocket), 'FM999'), 'unknown') || ' Sockets' m
+ from rhncpu where rhncpu.server_id = sid
+ union all
+ select 2, ni.name||' '||coalesce(na4.address,'')||'/'||coalesce(na4.netmask,'')||' '||ni.hw_addr val
+ from rhnservernetinterface ni,
+ rhnServerNetAddress4 na4
+ where ni.server_id = sid
+ and ni.id = na4.interface_id
+ ) X
+ order by n, m
+ ) loop
+ if ret is null then
+ ret := rec.m;
+ else
+ ret := ret || separator || rec.m;
+ end if;
+ end loop;
+ return ret;
+end;
+$$ language plpgsql;
+
11 years, 1 month
Changes to 'refs/tags/yum-rhn-plugin-1.10.1-1'
by StephenHerr
Tag 'yum-rhn-plugin-1.10.1-1' created by Stephen Herr <sherr(a)redhat.com> at 2013-04-03 18:47 +0000
Tagging package [yum-rhn-plugin] version [1.10.1-1] in directory [client/rhel/yum-rhn-plugin/].
Changes since rhn-client-tools-1.10.3-1:
Stephen Herr (1):
Automatic commit of package [yum-rhn-plugin] release [1.10.1-1].
---
client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec | 8 +++++++-
rel-eng/packages/yum-rhn-plugin | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
---
11 years, 1 month
Changes to 'refs/tags/rhn-client-tools-1.10.3-1'
by StephenHerr
Tag 'rhn-client-tools-1.10.3-1' created by Stephen Herr <sherr(a)redhat.com> at 2013-04-03 18:47 +0000
Tagging package [rhn-client-tools] version [1.10.3-1] in directory [client/rhel/rhn-client-tools/].
Changes since rhnlib-2.5.57-1:
Stephen Herr (1):
Automatic commit of package [rhn-client-tools] release [1.10.3-1].
---
client/rhel/rhn-client-tools/rhn-client-tools.spec | 6 +++++-
rel-eng/packages/rhn-client-tools | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
---
11 years, 1 month
Changes to 'refs/tags/rhnlib-2.5.57-1'
by StephenHerr
Tag 'rhnlib-2.5.57-1' created by Stephen Herr <sherr(a)redhat.com> at 2013-04-03 18:46 +0000
Tagging package [rhnlib] version [2.5.57-1] in directory [client/rhel/rhnlib/].
Changes since spacewalk-java-1.10.39-1:
Stephen Herr (2):
947639 - Make timeout of yum-rhn-plugin calls through rhn-client-tools configurable
Automatic commit of package [rhnlib] release [2.5.57-1].
---
client/rhel/rhn-client-tools/rhn-client-tools.spec | 2
client/rhel/rhn-client-tools/src/up2date_client/rhnChannel.py | 8 -
client/rhel/rhn-client-tools/src/up2date_client/rhnPackageInfo.py | 4
client/rhel/rhn-client-tools/src/up2date_client/rhnserver.py | 5
client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py | 5
client/rhel/rhn-client-tools/src/up2date_client/up2dateAuth.py | 12 +-
client/rhel/rhnlib/rhn/rpclib.py | 26 ++---
client/rhel/rhnlib/rhn/transports.py | 51 +++++++---
client/rhel/rhnlib/rhnlib.spec | 6 -
client/rhel/yum-rhn-plugin/rhnplugin.py | 18 +--
client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec | 2
rel-eng/packages/rhnlib | 2
12 files changed, 88 insertions(+), 53 deletions(-)
---
11 years, 1 month
4 commits - client/rhel rel-eng/packages
by StephenHerr
client/rhel/rhn-client-tools/rhn-client-tools.spec | 8 +
client/rhel/rhn-client-tools/src/up2date_client/rhnChannel.py | 8 -
client/rhel/rhn-client-tools/src/up2date_client/rhnPackageInfo.py | 4
client/rhel/rhn-client-tools/src/up2date_client/rhnserver.py | 5
client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py | 5
client/rhel/rhn-client-tools/src/up2date_client/up2dateAuth.py | 12 +-
client/rhel/rhnlib/rhn/rpclib.py | 26 ++---
client/rhel/rhnlib/rhn/transports.py | 51 +++++++---
client/rhel/rhnlib/rhnlib.spec | 6 -
client/rhel/yum-rhn-plugin/rhnplugin.py | 18 +--
client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec | 10 +
rel-eng/packages/rhn-client-tools | 2
rel-eng/packages/rhnlib | 2
rel-eng/packages/yum-rhn-plugin | 2
14 files changed, 102 insertions(+), 57 deletions(-)
New commits:
commit 135d3cc93150dae691784a9a66f89b7945ed3f1d
Author: Stephen Herr <sherr(a)redhat.com>
Date: Wed Apr 3 14:47:39 2013 -0400
Automatic commit of package [yum-rhn-plugin] release [1.10.1-1].
diff --git a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
index 10292c4..4a2bb40 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.10.0
+Version: 1.10.1
Release: 1%{?dist}
License: GPLv2
Group: System Environment/Base
@@ -70,6 +70,12 @@ fi
%doc LICENSE
%changelog
+* Wed Apr 03 2013 Stephen Herr <sherr(a)redhat.com> 1.10.1-1
+- 947639 - Make timeout of yum-rhn-plugin calls through rhn-client-tools
+ configurable
+- Bumping package versions for 1.9
+- Purging %%changelog entries preceding Spacewalk 1.0, in active packages.
+
* Fri Feb 15 2013 Milan Zazrivec <mzazrivec(a)redhat.com> 1.9.4-1
- Update .po and .pot files for yum-rhn-plugin.
- New translations from Transifex for yum-rhn-plugin.
diff --git a/rel-eng/packages/yum-rhn-plugin b/rel-eng/packages/yum-rhn-plugin
index e627418..1916998 100644
--- a/rel-eng/packages/yum-rhn-plugin
+++ b/rel-eng/packages/yum-rhn-plugin
@@ -1 +1 @@
-1.9.4-1 client/rhel/yum-rhn-plugin/
+1.10.1-1 client/rhel/yum-rhn-plugin/
commit bb9c025f53781ea793a575fe790d3c1f0a54fbc9
Author: Stephen Herr <sherr(a)redhat.com>
Date: Wed Apr 3 14:47:00 2013 -0400
Automatic commit of package [rhn-client-tools] release [1.10.3-1].
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 5e1cc87..6c39117 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -4,7 +4,7 @@ Group: System Environment/Base
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
URL: https://fedorahosted.org/spacewalk
Name: rhn-client-tools
-Version: 1.10.2
+Version: 1.10.3
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -339,6 +339,10 @@ make -f Makefile.rhn-client-tools test
%endif
%changelog
+* Wed Apr 03 2013 Stephen Herr <sherr(a)redhat.com> 1.10.3-1
+- 947639 - Make timeout of yum-rhn-plugin calls through rhn-client-tools
+ configurable
+
* Mon Mar 25 2013 Stephen Herr <sherr(a)redhat.com> 1.10.2-1
- Client tools able to pass up socket info
diff --git a/rel-eng/packages/rhn-client-tools b/rel-eng/packages/rhn-client-tools
index 4366590..942cbc9 100644
--- a/rel-eng/packages/rhn-client-tools
+++ b/rel-eng/packages/rhn-client-tools
@@ -1 +1 @@
-1.10.2-1 client/rhel/rhn-client-tools/
+1.10.3-1 client/rhel/rhn-client-tools/
commit 25972783fad6af62930411812a2f14579bd04978
Author: Stephen Herr <sherr(a)redhat.com>
Date: Wed Apr 3 14:46:32 2013 -0400
Automatic commit of package [rhnlib] release [2.5.57-1].
diff --git a/client/rhel/rhnlib/rhnlib.spec b/client/rhel/rhnlib/rhnlib.spec
index 1cbbab2..c33088c 100644
--- a/client/rhel/rhnlib/rhnlib.spec
+++ b/client/rhel/rhnlib/rhnlib.spec
@@ -4,7 +4,7 @@ Summary: Python libraries for the RHN project
Name: rhnlib
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 2.5.56
+Version: 2.5.57
Release: 1%{?dist}
Group: Development/Libraries
@@ -60,6 +60,10 @@ rm -rf $RPM_BUILD_ROOT
%{python_sitelib}/*
%changelog
+* Wed Apr 03 2013 Stephen Herr <sherr(a)redhat.com> 2.5.57-1
+- 947639 - Make timeout of yum-rhn-plugin calls through rhn-client-tools
+ configurable
+
* Tue Apr 02 2013 Stephen Herr <sherr(a)redhat.com> 2.5.56-1
- 947639 - make Proxy timeouts configurable
- Purging %%changelog entries preceding Spacewalk 1.0, in active packages.
diff --git a/rel-eng/packages/rhnlib b/rel-eng/packages/rhnlib
index 1482bf2..c1c6d0b 100644
--- a/rel-eng/packages/rhnlib
+++ b/rel-eng/packages/rhnlib
@@ -1 +1 @@
-2.5.56-1 client/rhel/rhnlib/
+2.5.57-1 client/rhel/rhnlib/
commit b2c9611f28d5339aa74361ea4ff7040a772f33a5
Author: Stephen Herr <sherr(a)redhat.com>
Date: Wed Apr 3 14:43:03 2013 -0400
947639 - Make timeout of yum-rhn-plugin calls through rhn-client-tools configurable
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 7703196..5e1cc87 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -12,7 +12,7 @@ BuildArch: noarch
BuildRequires: update-desktop-files
%endif
-Requires: rhnlib >= 2.5.41
+Requires: rhnlib >= 2.5.57
Requires: rpm >= 4.2.3-24_nonptl
Requires: rpm-python
Requires: python-ethtool >= 0.4
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnChannel.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnChannel.py
index 34b70cf..c7436eb 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnChannel.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnChannel.py
@@ -65,10 +65,10 @@ class rhnChannelList:
# for the gui client that needs to show more info
# maybe we should always make this call? If nothing
# else, wrapper should have a way to show extended channel info
-def getChannelDetails():
+def getChannelDetails(timeout=None):
channels = []
- sourceChannels = getChannels()
+ sourceChannels = getChannels(timeout=timeout)
for sourceChannel in sourceChannels.channels():
if sourceChannel['type'] != 'up2date':
@@ -84,13 +84,13 @@ cmdline_pkgs = []
global selected_channels
selected_channels = None
-def getChannels(force=None, label_whitelist=None):
+def getChannels(force=None, label_whitelist=None, timeout=None):
""" return rhnChannelList containing list of channel we are subscribed to """
cfg = config.initUp2dateConfig()
global selected_channels
if not selected_channels and not force:
selected_channels = rhnChannelList()
- s = rhnserver.RhnServer()
+ s = rhnserver.RhnServer(timeout=timeout)
if not up2dateAuth.getSystemId():
raise up2dateErrors.NoSystemIdError(_("Unable to Locate SystemId"))
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnPackageInfo.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnPackageInfo.py
index 38eeaa2..a0270f6 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnPackageInfo.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnPackageInfo.py
@@ -16,12 +16,12 @@ def logDeltaPackages(pkgs):
log.log_me("Removing packages from package profile: %s" %
pprint_pkglist(pkgs['removed']))
-def updatePackageProfile():
+def updatePackageProfile(timeout=None):
""" get a list of installed packages and send it to rhnServer """
log = up2dateLog.initLog()
log.log_me("Updating package profile")
packages = pkgUtils.getInstalledPackageList(getArch=1)
- s = rhnserver.RhnServer()
+ s = rhnserver.RhnServer(timeout=timeout)
if not s.capabilities.hasCapability('xmlrpc.packages.extended_profile', 2):
# for older satellites and hosted - convert to old format
packages = convertPackagesFromHashToList(packages)
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnserver.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnserver.py
index eb6553d..4e936fc 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnserver.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnserver.py
@@ -163,8 +163,9 @@ class RhnServer(object):
level exceptions
"""
- def __init__(self, serverOverride=None):
- self._server = rpcServer.getServer(serverOverride=serverOverride)
+ def __init__(self, serverOverride=None, timeout=None):
+ self._server = rpcServer.getServer(serverOverride=serverOverride,
+ timeout=timeout)
self._capabilities = None
def __get_capabilities(self):
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py b/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py
index cddb5a8..e9e2e29 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py
@@ -107,7 +107,7 @@ class ServerList:
self.index = 0
-def getServer(refreshCallback=None, serverOverride=None):
+def getServer(refreshCallback=None, serverOverride=None, timeout=None):
log = up2dateLog.initLog()
cfg = config.initUp2dateConfig()
@@ -151,7 +151,8 @@ def getServer(refreshCallback=None, serverOverride=None):
refreshCallback=refreshCallback,
proxy=proxyHost,
username=proxyUser,
- password=proxyPassword)
+ password=proxyPassword,
+ timeout=timeout)
s.addServerList(serverList)
s.add_header("X-Up2date-Version", up2dateUtils.version())
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/up2dateAuth.py b/client/rhel/rhn-client-tools/src/up2date_client/up2dateAuth.py
index ef84f8b..02280b2 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/up2dateAuth.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/up2dateAuth.py
@@ -169,14 +169,14 @@ def _updateLoginInfo(li):
# allow to pass in a system id for use in rhnreg
# a bit of a kluge to make caps work correctly
-def login(systemId=None, forceUpdate=False):
+def login(systemId=None, forceUpdate=False, timeout=None):
log = up2dateLog.initLog()
log.log_debug("login(forceUpdate=%s) invoked" % (forceUpdate))
if not forceUpdate and not loginInfo:
if readCachedLogin():
return loginInfo
- server = rhnserver.RhnServer()
+ server = rhnserver.RhnServer(timeout=timeout)
# send up the capabality info
headerlist = clientCaps.caps.headerFormat()
@@ -206,17 +206,17 @@ def login(systemId=None, forceUpdate=False):
log.log_debug("logininfo:", loginInfo)
return loginInfo
-def updateLoginInfo():
+def updateLoginInfo(timeout=None):
log = up2dateLog.initLog()
log.log_me("updateLoginInfo() login info")
# NOTE: login() updates the loginInfo object
- login(forceUpdate=True)
+ login(forceUpdate=True, timeout=timeout)
if not loginInfo:
raise up2dateErrors.AuthenticationError("Unable to authenticate")
return loginInfo
-def getLoginInfo():
+def getLoginInfo(timeout=None):
global loginInfo
try:
loginInfo = loginInfo
@@ -225,6 +225,6 @@ def getLoginInfo():
if loginInfo:
return loginInfo
# NOTE: login() updates the loginInfo object
- login()
+ login(timeout=timeout)
return loginInfo
diff --git a/client/rhel/rhnlib/rhn/rpclib.py b/client/rhel/rhnlib/rhn/rpclib.py
index 3861d37..fa50fa7 100644
--- a/client/rhel/rhnlib/rhn/rpclib.py
+++ b/client/rhel/rhnlib/rhn/rpclib.py
@@ -128,7 +128,7 @@ class Server:
_transport_class_https_proxy = transports.SafeProxyTransport
def __init__(self, uri, transport=None, encoding=None, verbose=0,
proxy=None, username=None, password=None, refreshCallback=None,
- progressCallback=None):
+ progressCallback=None, timeout=None):
# establish a "logical" server connection
#
@@ -167,7 +167,8 @@ class Server:
if transport is None:
self._allow_redirect = 1
- transport = self.default_transport(self._type, proxy, username, password)
+ transport = self.default_transport(self._type, proxy, username,
+ password, timeout)
else:
#
# dont allow redirect on unknow transports, that should be
@@ -193,19 +194,20 @@ class Server:
self._headers = UserDictCase()
- def default_transport(self, type, proxy=None, username=None, password=None):
+ def default_transport(self, type, proxy=None, username=None, password=None,
+ timeout=None):
if proxy:
if type == 'https':
transport = self._transport_class_https_proxy(proxy,
- proxyUsername=username, proxyPassword=password)
+ proxyUsername=username, proxyPassword=password, timeout=timeout)
else:
transport = self._transport_class_proxy(proxy,
- proxyUsername=username, proxyPassword=password)
+ proxyUsername=username, proxyPassword=password, timeout=timeout)
else:
if type == 'https':
- transport = self._transport_class_https()
+ transport = self._transport_class_https(timeout=timeout)
else:
- transport = self._transport_class()
+ transport = self._transport_class(timeout=timeout)
return transport
def allow_redirect(self, allow):
@@ -529,14 +531,15 @@ class Server:
class GETServer(Server):
def __init__(self, uri, transport=None, proxy=None, username=None,
password=None, client_version=2, headers={}, refreshCallback=None,
- progressCallback=None):
+ progressCallback=None, timeout=None):
Server.__init__(self, uri,
proxy=proxy,
username=username,
password=password,
transport=transport,
refreshCallback=refreshCallback,
- progressCallback=progressCallback)
+ progressCallback=progressCallback,
+ timeout=timeout)
self._client_version = client_version
self._headers = headers
# Back up the original handler, since we mangle it
@@ -613,8 +616,9 @@ class GETServer(Server):
# magic method dispatcher
return SlicingMethod(self._request, name)
- def default_transport(self, type, proxy=None, username=None, password=None):
- ret = Server.default_transport(self, type, proxy=proxy, username=username, password=password)
+ def default_transport(self, type, proxy=None, username=None, password=None,
+ timeout=None):
+ ret = Server.default_transport(self, type, proxy=proxy, username=username, password=password, timeout=timeout)
ret.set_method("GET")
return ret
diff --git a/client/rhel/rhnlib/rhn/transports.py b/client/rhel/rhnlib/rhn/transports.py
index 85a3384..b865dc3 100644
--- a/client/rhel/rhnlib/rhn/transports.py
+++ b/client/rhel/rhnlib/rhn/transports.py
@@ -35,7 +35,7 @@ class Transport(xmlrpclib.Transport):
user_agent = "rhn.rpclib.py/%s" % __version__
def __init__(self, transfer=0, encoding=0, refreshCallback=None,
- progressCallback=None, use_datetime=None):
+ progressCallback=None, use_datetime=None, timeout=None):
self._transport_flags = {'transfer' : 0, 'encoding' : 0}
self.set_transport_flags(transfer=transfer, encoding=encoding)
self._headers = UserDictCase()
@@ -51,6 +51,7 @@ class Transport(xmlrpclib.Transport):
self.response_reason = None
self._redirected = None
self._use_datetime = use_datetime
+ self.timeout = timeout
# set the progress callback
def set_progress_callback(self, progressCallback, bufferSize=16384):
@@ -125,7 +126,10 @@ class Transport(xmlrpclib.Transport):
def get_connection(self, host):
if self.verbose:
print "Connecting via http to %s" % (host, )
- return connections.HTTPConnection(host)
+ if self.timeout:
+ return connections.HTTPConnection(host, timeout=self.timeout)
+ else:
+ return connections.HTTPConnection(host)
def request(self, host, handler, request_body, verbose=0):
# issue XML-RPC request
@@ -241,9 +245,10 @@ class Transport(xmlrpclib.Transport):
class SafeTransport(Transport):
def __init__(self, transfer=0, encoding=0, refreshCallback=None,
- progressCallback=None, trusted_certs=None):
+ progressCallback=None, trusted_certs=None, timeout=None):
Transport.__init__(self, transfer, encoding,
- refreshCallback=refreshCallback, progressCallback=progressCallback)
+ refreshCallback=refreshCallback, progressCallback=progressCallback,
+ timeout=timeout)
self.trusted_certs = []
for certfile in (trusted_certs or []):
self.add_trusted_cert(certfile)
@@ -258,14 +263,21 @@ class SafeTransport(Transport):
host, extra_headers, x509 = self.get_host_info(host)
if self.verbose:
print "Connecting via https to %s" % (host, )
- return connections.HTTPSConnection(host, trusted_certs=self.trusted_certs)
+ if self.timeout:
+ return connections.HTTPSConnection(host,
+ trusted_certs=self.trusted_certs, timeout=self.timeout)
+ else:
+ return connections.HTTPSConnection(host,
+ trusted_certs=self.trusted_certs)
class ProxyTransport(Transport):
def __init__(self, proxy, proxyUsername=None, proxyPassword=None,
- transfer=0, encoding=0, refreshCallback=None, progressCallback=None):
+ transfer=0, encoding=0, refreshCallback=None, progressCallback=None,
+ timeout=None):
Transport.__init__(self, transfer, encoding,
- refreshCallback=refreshCallback, progressCallback=progressCallback)
+ refreshCallback=refreshCallback, progressCallback=progressCallback,
+ timeout=timeout)
self._proxy = proxy
self._proxy_username = proxyUsername
self._proxy_password = proxyPassword
@@ -274,18 +286,24 @@ class ProxyTransport(Transport):
if self.verbose:
print "Connecting via http to %s proxy %s, username %s, pass %s" % (
host, self._proxy, self._proxy_username, self._proxy_password)
- return connections.HTTPProxyConnection(self._proxy, host,
- username=self._proxy_username, password=self._proxy_password)
+ if self.timeout:
+ return connections.HTTPProxyConnection(self._proxy, host,
+ username=self._proxy_username, password=self._proxy_password,
+ timeout=self.timeout)
+ else:
+ return connections.HTTPProxyConnection(self._proxy, host,
+ username=self._proxy_username, password=self._proxy_password)
class SafeProxyTransport(ProxyTransport):
def __init__(self, proxy, proxyUsername=None, proxyPassword=None,
transfer=0, encoding=0, refreshCallback=None,
- progressCallback=None, trusted_certs=None):
+ progressCallback=None, trusted_certs=None, timeout=None):
ProxyTransport.__init__(self, proxy,
proxyUsername=proxyUsername, proxyPassword=proxyPassword,
transfer=transfer, encoding=encoding,
refreshCallback=refreshCallback,
- progressCallback=progressCallback)
+ progressCallback=progressCallback,
+ timeout=timeout)
self.trusted_certs = []
for certfile in (trusted_certs or []):
self.add_trusted_cert(certfile)
@@ -299,9 +317,14 @@ class SafeProxyTransport(ProxyTransport):
if self.verbose:
print "Connecting via https to %s proxy %s, username %s, pass %s" % (
host, self._proxy, self._proxy_username, self._proxy_password)
- return connections.HTTPSProxyConnection(self._proxy, host,
- username=self._proxy_username, password=self._proxy_password,
- trusted_certs=self.trusted_certs)
+ if self.timeout:
+ return connections.HTTPSProxyConnection(self._proxy, host,
+ username=self._proxy_username, password=self._proxy_password,
+ trusted_certs=self.trusted_certs, timeout=self.timeout)
+ else:
+ return connections.HTTPSProxyConnection(self._proxy, host,
+ username=self._proxy_username, password=self._proxy_password,
+ trusted_certs=self.trusted_certs)
# ============================================================================
# Extended capabilities for transport
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py b/client/rhel/yum-rhn-plugin/rhnplugin.py
index 812dd87..900ab5c 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -64,6 +64,9 @@ def init_hook(conduit):
global rhn_enabled
RHN_DISABLED = _("RHN Satellite or RHN Classic support will be disabled.")
+
+ conduit_conf = conduit.getConf()
+ timeout = conduit_conf.timeout
if not os.geteuid()==0:
# If non-root notify user RHN repo not accessible
@@ -113,7 +116,7 @@ def init_hook(conduit):
return
try:
- login_info = up2dateAuth.getLoginInfo()
+ login_info = up2dateAuth.getLoginInfo(timeout=timeout)
except up2dateErrors.RhnServerException, e:
if hasattr(conduit._base, 'exit_code') and 'check-update' in sys.argv:
conduit._base.exit_code = 1
@@ -133,7 +136,7 @@ def init_hook(conduit):
CHANNELS_DISABLED = _("RHN channel support will be disabled.")
try:
- svrChannels = rhnChannel.getChannelDetails()
+ svrChannels = rhnChannel.getChannelDetails(timeout=timeout)
except up2dateErrors.NoChannelsError:
conduit.error(0, _("This system is not subscribed to any channels.") +
"\n" + CHANNELS_DISABLED)
@@ -156,8 +159,6 @@ def init_hook(conduit):
conduit.info(2, _("This system is receiving updates from RHN Classic or RHN Satellite."))
repos = conduit.getRepos()
- conduit_conf = conduit.getConf()
- timeout = conduit_conf.timeout
cachedir = conduit_conf.cachedir
sslcacert = get_ssl_ca_cert(up2date_cfg)
pluginOptions = getRHNRepoOptions(conduit, 'main')
@@ -268,6 +269,7 @@ def posttrans_hook(conduit):
""" Post rpm transaction hook. We update the RHN profile here. """
global rhn_enabled
if rhn_enabled:
+ timeout = conduit.getConf().timeout
up2date_cfg = config.initUp2dateConfig()
if up2date_cfg.has_key('writeChangesToLog') and up2date_cfg['writeChangesToLog'] == 1:
ts_info = conduit.getTsInfo()
@@ -275,7 +277,7 @@ def posttrans_hook(conduit):
rhnPackageInfo.logDeltaPackages(delta)
if up2dateAuth.getSystemId(): # are we registred?
try:
- rhnPackageInfo.updatePackageProfile()
+ rhnPackageInfo.updatePackageProfile(timeout=timeout)
except up2dateErrors.RhnServerException, e:
conduit.error(0, COMMUNICATION_ERROR + "\n" +
_("Package profile information could not be sent.") + "\n" +
@@ -357,7 +359,7 @@ class RhnRepo(YumRepository):
""" Set up self.http_headers with needed RHN X-RHN-blah headers """
try:
- li = up2dateAuth.getLoginInfo()
+ li = up2dateAuth.getLoginInfo(timeout=self.timeout)
except up2dateErrors.RhnServerException, e:
raise yum.Errors.RepoError(unicode(e)), None, sys.exc_info()[2]
except e:
@@ -386,7 +388,7 @@ class RhnRepo(YumRepository):
start, end, copy_local, checkfunc, text, reget, cache, size)
except URLGrabError, e:
try:
- up2dateAuth.updateLoginInfo()
+ up2dateAuth.updateLoginInfo(timeout=self.timeout)
except up2dateErrors.RhnServerException, e:
raise yum.Errors.RepoError(unicode(e)), None, sys.exc_info()[2]
@@ -573,7 +575,7 @@ class RhnRepo(YumRepository):
except yum.Errors.RepoError:
# Refresh our loginInfo then try again
# possibly it's out of date
- up2dateAuth.updateLoginInfo()
+ up2dateAuth.updateLoginInfo(timeout=self.timeout)
return YumRepository._getRepoXML(self)
def make_package_delta(ts_info):
diff --git a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
index 338aa7b..10292c4 100644
--- a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
+++ b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
@@ -15,7 +15,7 @@ BuildRequires: intltool
BuildRequires: gettext
Requires: yum >= 3.2.19-15
-Requires: rhn-client-tools >= 1.6.6-1
+Requires: rhn-client-tools >= 1.10.3-1
Requires: m2crypto >= 0.16-6
Requires: python-iniparse
11 years, 1 month