3 commits - backend/satellite_tools backend/server
by Michael Mraka
backend/satellite_tools/satCerts.py | 14 --------------
backend/satellite_tools/satsync.py | 5 +++--
backend/satellite_tools/sync_handlers.py | 3 ---
backend/server/importlib/backend.py | 3 ---
4 files changed, 3 insertions(+), 22 deletions(-)
New commits:
commit e7ea66e7094179379071cd2cc22145c631fd1214
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Sep 29 09:53:05 2011 +0200
removed dead exception
diff --git a/backend/satellite_tools/sync_handlers.py b/backend/satellite_tools/sync_handlers.py
index d7dc709..32d5638 100644
--- a/backend/satellite_tools/sync_handlers.py
+++ b/backend/satellite_tools/sync_handlers.py
@@ -28,9 +28,6 @@ import syncLib
DEFAULT_ORG = 1
-class NoFreeEntitlementsError(Exception):
- "No free entitlements available to activate this satellite"
-
# Singleton-like
class BaseCollection:
_shared_state = {}
diff --git a/backend/server/importlib/backend.py b/backend/server/importlib/backend.py
index dc2a0b8..01f1c91 100644
--- a/backend/server/importlib/backend.py
+++ b/backend/server/importlib/backend.py
@@ -52,9 +52,6 @@ sequences = {
'rhnPackageChangeLogData' : 'rhn_pkg_cld_id_seq',
}
-class NoFreeEntitlementsError(Exception):
- "No free entitlements available to activate this satellite"
-
class Backend:
# This object is initialized by the specific subclasses (e.g.
# OracleBackend)
commit 442aff52e7d55b6cc2863c2275a9f9d05bdddb42
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Sep 27 14:04:43 2011 +0200
removed dead queries
diff --git a/backend/satellite_tools/satCerts.py b/backend/satellite_tools/satCerts.py
index ab22811..beb9523 100644
--- a/backend/satellite_tools/satCerts.py
+++ b/backend/satellite_tools/satCerts.py
@@ -301,14 +301,6 @@ def storeRhnCert(cert, check_generation=0, check_version=0):
rhnSQL.commit()
-_query_update_dates = rhnSQL.Statement("""
- UPDATE rhnSatelliteCert
- SET issued = :issued, expires = :expires
- WHERE label = :label
- AND ((version is null and :version is null)
- OR version = :version)
-""")
-
_query_latest_version = rhnSQL.Statement("""
SELECT COALESCE(version, 0) as version, version as orig_version, cert,
TO_CHAR(issued, 'YYYY-MM-DD HH24:MI:SS') as issued,
@@ -348,12 +340,6 @@ _query_update_web_user = rhnSQL.Statement("""
SET company = :owner
""")
-_query_update_rhnchannelfamily = rhnSQL.Statement("""
- UPDATE rhnchannelfamily
- SET name = :owner
- WHERE org_id = 1
-""")
-
#
# Monitoring Scout Config Push section
# Stuff needed to push scout configs after a successful sat-cert activation
commit e7fac130b843deadde44f724d9a4ecbf16221883
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Sep 14 11:00:05 2011 +0200
made syncCert() more readable
aka don't return from the middle
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index cfc57f6..3c252d3 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -518,6 +518,7 @@ class Syncer:
def syncCert(self):
"sync the RHN satellite cert if applicable (to local DB & filesystem)"
+ store_cert = True
if self.mountpoint:
if self.rhn_cert:
# Certificate was presented on the command line
@@ -534,14 +535,14 @@ class Syncer:
raise RhnSyncException(_("No certificate found. "
"Please use --rhn-cert"))
cert = row['cert']
- return self._process_cert(cert, store_cert=0)
+ store_cert = False
else:
log2(1, 3, ["", _("RHN Entitlement Certificate sync")])
certSource = xmlWireSource.CertWireSource(self.systemid, self.sslYN,
self.xml_dump_version)
cert = string.strip(certSource.download())
- return self._process_cert(cert)
+ return self._process_cert(cert, store_cert)
def _process_cert(self, cert, store_cert=1):
"""Give the cert a check - if it's broken xml we'd better find it out
11 years, 8 months
Changes to 'refs/tags/spacewalk-backend-1.6.24-1'
by Michael Mraka
Tag 'spacewalk-backend-1.6.24-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2011-09-30 14:36 +0000
Tagging package [spacewalk-backend] version [1.6.24-1] in directory [backend/].
Changes since spacewalk-web-1.6.25-1:
Michael Mraka (2):
740542 - don't use executemany for queries with blobs
Automatic commit of package [spacewalk-backend] release [1.6.24-1].
---
backend/server/importlib/backendLib.py | 15 +++++++++++----
backend/spacewalk-backend.spec | 5 ++++-
rel-eng/packages/spacewalk-backend | 2 +-
3 files changed, 16 insertions(+), 6 deletions(-)
---
11 years, 8 months
backend/spacewalk-backend.spec rel-eng/packages
by Michael Mraka
backend/spacewalk-backend.spec | 5 ++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit b093142ac3c7afc5d2bcb17ce155d43cddc42e84
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Sep 30 16:36:32 2011 +0200
Automatic commit of package [spacewalk-backend] release [1.6.24-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 16257cd..bb615b5 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -12,7 +12,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2 and Python
-Version: 1.6.23
+Version: 1.6.24
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -675,6 +675,9 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Fri Sep 30 2011 Michael Mraka <michael.mraka(a)redhat.com> 1.6.24-1
+- 740542 - don't use executemany for queries with blobs
+
* Fri Sep 30 2011 Jan Pazdziora 1.6.23-1
- 621531 - update the path in the man page, plus some polishing.
- 621531 - update backend rhnConfig to use the new /usr/share/rhn/config-
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 76a5e5a..1741d95 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.6.23-1 backend/
+1.6.24-1 backend/
11 years, 8 months
backend/server
by Michael Mraka
backend/server/importlib/backendLib.py | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
New commits:
commit 07580324c3aa58ba609492236bef65c436ffe1e9
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Sep 30 16:28:10 2011 +0200
740542 - don't use executemany for queries with blobs
diff --git a/backend/server/importlib/backendLib.py b/backend/server/importlib/backendLib.py
index 484294a..cba3999 100644
--- a/backend/server/importlib/backendLib.py
+++ b/backend/server/importlib/backendLib.py
@@ -418,20 +418,21 @@ class TableInsert(TableUpdate):
def query(self, values):
if self.blob_fields:
+ chunksize = 1
blob_map = {}
for f in self.blob_fields:
blob_map[f] = f
else:
+ chunksize = self.count
blob_map = None
# Do the insert
statement = self._getCachedQuery(None, blob_map=blob_map)
- executeStatement(statement, values, self.count)
+ executeStatement(statement, values, chunksize)
def executeStatement(statement, valuesHash, chunksize):
# Executes a statement with chunksize values at the time
- chunksize = 1000
if not valuesHash:
# Empty hash
return
@@ -442,13 +443,19 @@ def executeStatement(statement, valuesHash, chunksize):
if not vals:
# Empty
break
- tempdict[k] = vals[:chunksize]
+ if chunksize > 1:
+ tempdict[k] = vals[:chunksize]
+ else:
+ tempdict[k] = vals[0]
del vals[:chunksize]
if not tempdict:
# Empty dictionary: we're done
break
# Now execute it
- count = count + apply(statement.executemany, (), tempdict)
+ if chunksize > 1:
+ count += statement.executemany(**tempdict)
+ else:
+ count += statement.execute(**tempdict)
return count
11 years, 8 months
Changes to 'refs/tags/spacewalk-web-1.6.25-1'
by Jan Pazdziora
Tag 'spacewalk-web-1.6.25-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2011-09-30 14:34 +0000
Tagging package [spacewalk-web] version [1.6.25-1] in directory [web/].
Changes since spacewalk-java-1.6.51-1:
Jan Pazdziora (1):
Automatic commit of package [spacewalk-web] release [1.6.25-1].
---
rel-eng/packages/spacewalk-web | 2 +-
web/spacewalk-web.spec | 11 ++++++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
---
11 years, 8 months
rel-eng/packages web/spacewalk-web.spec
by Jan Pazdziora
rel-eng/packages/spacewalk-web | 2 +-
web/spacewalk-web.spec | 11 ++++++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
New commits:
commit 191a1dbcdf343cd811297787a84027b8e547a824
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Sep 30 16:34:26 2011 +0200
Automatic commit of package [spacewalk-web] release [1.6.25-1].
diff --git a/rel-eng/packages/spacewalk-web b/rel-eng/packages/spacewalk-web
index c59ded5..131d434 100644
--- a/rel-eng/packages/spacewalk-web
+++ b/rel-eng/packages/spacewalk-web
@@ -1 +1 @@
-1.6.24-1 web/
+1.6.25-1 web/
diff --git a/web/spacewalk-web.spec b/web/spacewalk-web.spec
index 24fc5d4..6665b41 100644
--- a/web/spacewalk-web.spec
+++ b/web/spacewalk-web.spec
@@ -2,7 +2,7 @@ Name: spacewalk-web
Summary: Spacewalk Web site - Perl modules
Group: Applications/Internet
License: GPLv2
-Version: 1.6.24
+Version: 1.6.25
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk/
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -256,6 +256,15 @@ rm -rf $RPM_BUILD_ROOT
# $Id$
%changelog
+* Fri Sep 30 2011 Jan Pazdziora 1.6.25-1
+- 678118 - if system already is proxy, losen the ACL and show the tab.
+- Recent commit makes version_string_to_evr_array unused, dropping.
+- Removing proxy_evr_at_least, org_proxy_evr_at_least, aclOrgProxyEvrAtLeast as
+ they are no longer used.
+- Remove proxy_evr_at_least ACLs -- all supported proxy versions are 3+.
+- Make the pxt Connection acl match the java version -- new acl
+ org_has_proxies.
+
* Fri Sep 30 2011 Jan Pazdziora 1.6.24-1
- 621531 - update web Config to use the new /usr/share/rhn/config-defaults
location.
11 years, 8 months
Changes to 'refs/tags/spacewalk-java-1.6.51-1'
by Jan Pazdziora
Tag 'spacewalk-java-1.6.51-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2011-09-30 14:33 +0000
Tagging package [spacewalk-java] version [1.6.51-1] in directory [java/].
Changes since osad-5.10.23-1:
Jan Pazdziora (8):
Make the pxt Connection acl match the java version -- new acl org_has_proxies.
Remove proxy_evr_at_least ACLs -- all supported proxy versions are 3+.
Removing proxy_evr_at_least, org_proxy_evr_at_least, aclOrgProxyEvrAtLeast as they are no longer used.
Removing org_proxy_servers_evr query as it is no longer used.
Removing make_server_proxy query as it is no longer used.
Recent commit makes version_string_to_evr_array unused, dropping.
678118 - if system already is proxy, losen the ACL and show the tab.
Automatic commit of package [spacewalk-java] release [1.6.51-1].
Tomas Lestach (1):
602179 - limit fake generated password to maximal password length
---
java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml | 10 --
java/code/src/com/redhat/rhn/common/db/datasource/xml/test_queries.xml | 9 -
java/code/src/com/redhat/rhn/common/security/acl/Access.java | 42 --------
java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java | 23 ----
java/code/src/com/redhat/rhn/frontend/action/multiorg/OrgCreateAction.java | 17 ++-
java/code/webapp/WEB-INF/nav/system_detail.xml | 4
java/spacewalk-java.spec | 12 ++
rel-eng/packages/spacewalk-java | 2
web/html/nav/system_detail.xml | 6 -
web/modules/rhn/RHN/Access/System.pm | 50 +---------
10 files changed, 32 insertions(+), 143 deletions(-)
---
11 years, 8 months
java/spacewalk-java.spec rel-eng/packages
by Jan Pazdziora
java/spacewalk-java.spec | 12 +++++++++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 12 insertions(+), 2 deletions(-)
New commits:
commit c7b07984c8c9af131f6b7806bd491a1638e1ee63
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Sep 30 16:33:54 2011 +0200
Automatic commit of package [spacewalk-java] release [1.6.51-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index 52d57eb..92573e9 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -17,7 +17,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.6.50
+Version: 1.6.51
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -557,6 +557,16 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Fri Sep 30 2011 Jan Pazdziora 1.6.51-1
+- 678118 - if system already is proxy, losen the ACL and show the tab.
+- Removing make_server_proxy query as it is no longer used.
+- Removing org_proxy_servers_evr query as it is no longer used.
+- Removing proxy_evr_at_least, org_proxy_evr_at_least, aclOrgProxyEvrAtLeast as
+ they are no longer used.
+- Remove proxy_evr_at_least ACLs -- all supported proxy versions are 3+.
+- 602179 - limit fake generated password to maximal password length
+ (tlestach(a)redhat.com)
+
* Fri Sep 30 2011 Jan Pazdziora 1.6.50-1
- 621531 - update java build configs to use the new /usr/share/rhn/config-
defaults location.
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 1e70ea1..3a50df0 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.6.50-1 java/
+1.6.51-1 java/
11 years, 8 months
java/code web/html
by Jan Pazdziora
java/code/webapp/WEB-INF/nav/system_detail.xml | 2 +-
web/html/nav/system_detail.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 170fd91e08fa47c10512c7e754a51ae5cd4b07ee
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Sep 30 16:32:29 2011 +0200
678118 - if system already is proxy, losen the ACL and show the tab.
diff --git a/java/code/webapp/WEB-INF/nav/system_detail.xml b/java/code/webapp/WEB-INF/nav/system_detail.xml
index 3faac54..2382277 100644
--- a/java/code/webapp/WEB-INF/nav/system_detail.xml
+++ b/java/code/webapp/WEB-INF/nav/system_detail.xml
@@ -8,7 +8,7 @@
<rhn-tab-url>/network/systems/details/remote_commands.pxt</rhn-tab-url>
</rhn-tab>
<rhn-tab name="Connection" url="/network/systems/details/connection.pxt" acl="org_has_proxies()"/>
- <rhn-tab name="Proxy" url="/network/systems/details/proxy.pxt" acl="user_role(org_admin); system_feature(ftr_proxy_capable); org_channel_family(rhn-proxy); child_channel_candidate(rhn-proxy); not system_is_satellite(); not is_solaris();system_feature(ftr_kickstart) or system_feature(ftr_snapshotting)">
+ <rhn-tab name="Proxy" url="/network/systems/details/proxy.pxt" acl="user_role(org_admin); system_feature(ftr_proxy_capable) or system_is_proxy(); org_channel_family(rhn-proxy) or system_is_proxy(); child_channel_candidate(rhn-proxy) or system_is_proxy(); not system_is_satellite(); not is_solaris();system_feature(ftr_kickstart) or system_feature(ftr_snapshotting)">
<rhn-tab name="Activation" url="/network/systems/details/proxy.pxt" />
<rhn-tab name="Systems Using Proxy" url="/network/systems/details/proxy-clients.pxt" acl="system_is_proxy() "/>
</rhn-tab>
diff --git a/web/html/nav/system_detail.xml b/web/html/nav/system_detail.xml
index 4ef88da..ccb3bbc 100644
--- a/web/html/nav/system_detail.xml
+++ b/web/html/nav/system_detail.xml
@@ -8,7 +8,7 @@
<rhn-tab-url>/network/systems/details/remote_commands.pxt</rhn-tab-url>
</rhn-tab>
<rhn-tab name="Connection" url="/network/systems/details/connection.pxt" acl="org_has_proxies()"/>
- <rhn-tab name="Proxy" url="/network/systems/details/proxy.pxt" acl="user_role(org_admin); system_feature(ftr_proxy_capable); org_channel_family(rhn-proxy); child_channel_candidate(rhn-proxy); org_entitlement(rhn_provisioning); not system_is_satellite(); not is_solaris();system_feature(ftr_kickstart) or system_feature(ftr_snapshotting)">
+ <rhn-tab name="Proxy" url="/network/systems/details/proxy.pxt" acl="user_role(org_admin); system_feature(ftr_proxy_capable) or system_is_proxy(); org_channel_family(rhn-proxy) or system_is_proxy(); child_channel_candidate(rhn-proxy) or system_is_proxy(); org_entitlement(rhn_provisioning); not system_is_satellite(); not is_solaris();system_feature(ftr_kickstart) or system_feature(ftr_snapshotting)">
<rhn-tab name="Activation" url="/network/systems/details/proxy.pxt" />
<rhn-tab name="Systems Using Proxy" url="/network/systems/details/proxy-clients.pxt" acl="system_is_proxy()"/>
</rhn-tab>
11 years, 8 months
6 commits - java/code web/html web/modules
by Jan Pazdziora
java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml | 10 --
java/code/src/com/redhat/rhn/common/db/datasource/xml/test_queries.xml | 9 -
java/code/src/com/redhat/rhn/common/security/acl/Access.java | 42 --------
java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java | 23 ----
java/code/webapp/WEB-INF/nav/system_detail.xml | 2
web/html/nav/system_detail.xml | 4
web/modules/rhn/RHN/Access/System.pm | 50 +---------
7 files changed, 8 insertions(+), 132 deletions(-)
New commits:
commit 45c88f3d002e3790c3295d397c3fe8f477bc52ce
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Sep 30 16:16:31 2011 +0200
Recent commit makes version_string_to_evr_array unused, dropping.
diff --git a/web/modules/rhn/RHN/Access/System.pm b/web/modules/rhn/RHN/Access/System.pm
index 9b6865a..05f00e3 100644
--- a/web/modules/rhn/RHN/Access/System.pm
+++ b/web/modules/rhn/RHN/Access/System.pm
@@ -139,17 +139,6 @@ sub org_has_proxies {
return 0;
}
-# Given a string of the form 'version-release(:epoch)', return an
-# array of (epoch, version, release)
-sub version_string_to_evr_array {
- my $version = shift;
-
- my @vre = split(/[-:]/, $version);
- my @target_evr = ((exists $vre[2] ? $vre[2] : '0'), $vre[0], $vre[1]);
-
- return @target_evr;
-}
-
sub package_available_to_system {
my $pxt = shift;
my $package_name = shift;
commit 5b6de23a086e4c1f1510f3035ab355a582bbcc6c
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Sep 30 16:14:47 2011 +0200
Removing make_server_proxy query as it is no longer used.
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/test_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/test_queries.xml
index 30b6efb..14c068f 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/test_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/test_queries.xml
@@ -331,15 +331,6 @@ VALUES (:server_id,
</query>
</mode>
-<write-mode name="make_server_proxy">
- <query params="server_id, evr_id">
-INSERT
- INTO rhnProxyInfo
- (server_id, proxy_evr_id)
-VALUES (:server_id, :evr_id)
- </query>
-</write-mode>
-
<write-mode name="ready_errata_cache_queue">
<query params="org_id, server_count, processed">
INSERT
commit f035523eadd7ca4815cdbffbd50474d5829fffd4
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Sep 30 16:13:57 2011 +0200
Removing org_proxy_servers_evr query as it is no longer used.
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
index 94cd23f..2c93cb1 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
@@ -953,16 +953,6 @@ SELECT PI.server_id ID, S.name, TO_CHAR(Sinfo.checkin, 'YYYY-MM-DD HH24:MI:SS')
</query>
</mode>
-<mode name="org_proxy_servers_evr" class="com.redhat.rhn.domain.rhnpackage.PackageEvr">
- <query params="org_id">
-SELECT PE.epoch, PE.version, PE.release
- FROM rhnServer S, rhnProxyInfo PI, rhnPackageEVR PE
- WHERE S.org_id = :org_id
- AND PI.server_id = S.id
- AND PI.proxy_evr_id = PE.id
- </query>
-</mode>
-
<mode name="proxy_path_for_server" class="com.redhat.rhn.frontend.dto.ServerPath">
<query params="sid">
SELECT SP.proxy_server_id ID, S.name, (SP.position + 1) AS position, SP.hostname
commit eef7c8adeb01898ac93507b5418768101eead899
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Sep 30 16:12:28 2011 +0200
Removing proxy_evr_at_least, org_proxy_evr_at_least, aclOrgProxyEvrAtLeast as they are no longer used.
diff --git a/java/code/src/com/redhat/rhn/common/security/acl/Access.java b/java/code/src/com/redhat/rhn/common/security/acl/Access.java
index 69bcfa7..7827c3f 100644
--- a/java/code/src/com/redhat/rhn/common/security/acl/Access.java
+++ b/java/code/src/com/redhat/rhn/common/security/acl/Access.java
@@ -263,48 +263,6 @@ public class Access extends BaseHandler implements AclHandler {
}
/**
- * FIXME not implemented. Currently this method
- * is unimplemented and ALWAYS returns false
- * @param ctx Context Map to pass in
- * @param params Parameters to use to fetch from Context
- * @return true if access is granted, false otherwise
- */
- public boolean aclOrgProxyEvrAtLeast(Object ctx, String[] params) {
- Map map = (Map) ctx;
- User user = (User) map.get("user");
- String version = params[0];
-
- //Generate the EVR from the parameter string
- String[] temp = version.split("[:-]");
- PackageEvr paramEVR;
- if (temp.length > 2) {
- paramEVR = new PackageEvr(temp[2], temp[0], temp[1]);
- }
- else {
- paramEVR = new PackageEvr(null, temp[0], temp[1]);
- }
-
- //Get EVRs for each proxy server in this org
- SelectMode m = ModeFactory.getMode("System_queries",
- "org_proxy_servers_evr");
- Map queryParams = new HashMap();
- queryParams.put("org_id", user.getOrg().getId());
- Iterator i = m.execute(queryParams).iterator();
-
- //Loop through the dataresult and if one EVR is at least
- //equal to the parameter EVR
- while (i.hasNext()) {
- PackageEvr next = (PackageEvr) i.next();
- int j = next.compareTo(paramEVR);
- if (j >= 0) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
* Check that the current user has access to the probe suite.
* The id of the suite must be in the parameter <code>suite_id</code>
* @param ctx acl context
diff --git a/java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java b/java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java
index be52d2f..a6d9479 100644
--- a/java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java
+++ b/java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java
@@ -235,29 +235,6 @@ public class AccessTest extends RhnBaseTestCase {
- public void testOrgProxyEvrAtLeast() throws Exception {
- Map context = new HashMap();
- User user = UserTestUtils.findNewUser("testUser", "testOrg");
- context.put("user", user);
- String param = "org_proxy_evr_at_least(3.6-2)";
- String param2 = "org_proxy_evr_at_least(3.6-3)";
-
- Server server = ServerFactoryTest.createTestServer(user);
- PackageEvr evr = PackageEvrFactory.createPackageEvr(null, "3.6", "2");
-
- WriteMode m = ModeFactory.
- getWriteMode("test_queries", "make_server_proxy");
- Map params = new HashMap();
- params.put("server_id", server.getId());
- params.put("evr_id", evr.getId());
- m.executeUpdate(params);
-
- boolean access = acl.evalAcl(context, param);
- assertTrue(access);
- access = acl.evalAcl(context, param2);
- assertFalse(access);
- }
-
public void testUnimplementedMethods() {
String[] methods = { "user_authenticated()" };
diff --git a/web/modules/rhn/RHN/Access/System.pm b/web/modules/rhn/RHN/Access/System.pm
index d197b8b..9b6865a 100644
--- a/web/modules/rhn/RHN/Access/System.pm
+++ b/web/modules/rhn/RHN/Access/System.pm
@@ -36,8 +36,6 @@ sub register_acl_handlers {
$acl->register_handler(system_kickstart_session_exists => \&kickstart_session_exists);
$acl->register_handler(system_packaging_type => \&system_packaging_type);
$acl->register_handler(system_profile_capable => \&system_profile_capable);
- $acl->register_handler(proxy_evr_at_least => \&proxy_evr_at_least);
- $acl->register_handler(org_proxy_evr_at_least => \&org_proxy_evr_at_least);
$acl->register_handler(org_has_proxies => \&org_has_proxies);
$acl->register_handler(package_available => \&package_available_to_system);
$acl->register_handler(action_pending_named => \&action_pending_named);
@@ -127,48 +125,6 @@ sub system_profile_capable {
return 0;
}
-# Returns true if system is a proxy, and it reports an evr in
-# rhnProxyInfo, and that evr is greater than or equal to the input
-sub proxy_evr_at_least {
- my $pxt = shift;
- my $version = shift;
-
- my $sid = $pxt->param('sid');
-
- return 0 unless $sid;
- return 0 unless $version;
-
- my @system_evr = RHN::Server->proxy_evr($sid);
- my @target_evr = version_string_to_evr_array($version);
-
- return 0 unless (@system_evr);
-
- return 1 if RHN::Package->vercmp(@system_evr, @target_evr) >= 0;
-
- return 0;
-}
-
-# Return true if the org has at least one registered proxy whose
-# version is greater than the provided version
-sub org_proxy_evr_at_least {
- my $pxt = shift;
- my $version = shift;
-
- my @target_evr = version_string_to_evr_array($version);
-
- my $ds = new RHN::DataSource::System (-mode => 'org_proxy_servers');
- my $data = $ds->execute_query(-org_id => $pxt->user->org_id);
-
- foreach my $row (@{$data}) {
- my @system_evr = RHN::Server->proxy_evr($row->{ID});
-
- next unless (@system_evr);
- return 1 if RHN::Package->vercmp(@system_evr, @target_evr) >= 0;
- }
-
- return 0;
-}
-
# Return true if the org has at least one registered proxy
sub org_has_proxies {
my $pxt = shift;
commit 90b5efeb9e4d936048ee6bae6f4baad24726ebb0
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Sep 30 16:09:43 2011 +0200
Remove proxy_evr_at_least ACLs -- all supported proxy versions are 3+.
diff --git a/java/code/webapp/WEB-INF/nav/system_detail.xml b/java/code/webapp/WEB-INF/nav/system_detail.xml
index 23fa5f0..3faac54 100644
--- a/java/code/webapp/WEB-INF/nav/system_detail.xml
+++ b/java/code/webapp/WEB-INF/nav/system_detail.xml
@@ -10,7 +10,7 @@
<rhn-tab name="Connection" url="/network/systems/details/connection.pxt" acl="org_has_proxies()"/>
<rhn-tab name="Proxy" url="/network/systems/details/proxy.pxt" acl="user_role(org_admin); system_feature(ftr_proxy_capable); org_channel_family(rhn-proxy); child_channel_candidate(rhn-proxy); not system_is_satellite(); not is_solaris();system_feature(ftr_kickstart) or system_feature(ftr_snapshotting)">
<rhn-tab name="Activation" url="/network/systems/details/proxy.pxt" />
- <rhn-tab name="Systems Using Proxy" url="/network/systems/details/proxy-clients.pxt" acl="system_is_proxy();proxy_evr_at_least(3.1-1)"/>
+ <rhn-tab name="Systems Using Proxy" url="/network/systems/details/proxy-clients.pxt" acl="system_is_proxy() "/>
</rhn-tab>
<rhn-tab name="Reactivation" url="/network/systems/details/activation.pxt" acl="system_feature(ftr_agent_smith)"/>
<rhn-tab name="Hardware">
diff --git a/web/html/nav/system_detail.xml b/web/html/nav/system_detail.xml
index ff54fb1..4ef88da 100644
--- a/web/html/nav/system_detail.xml
+++ b/web/html/nav/system_detail.xml
@@ -10,7 +10,7 @@
<rhn-tab name="Connection" url="/network/systems/details/connection.pxt" acl="org_has_proxies()"/>
<rhn-tab name="Proxy" url="/network/systems/details/proxy.pxt" acl="user_role(org_admin); system_feature(ftr_proxy_capable); org_channel_family(rhn-proxy); child_channel_candidate(rhn-proxy); org_entitlement(rhn_provisioning); not system_is_satellite(); not is_solaris();system_feature(ftr_kickstart) or system_feature(ftr_snapshotting)">
<rhn-tab name="Activation" url="/network/systems/details/proxy.pxt" />
- <rhn-tab name="Systems Using Proxy" url="/network/systems/details/proxy-clients.pxt" acl="system_is_proxy();proxy_evr_at_least(3.1-1)"/>
+ <rhn-tab name="Systems Using Proxy" url="/network/systems/details/proxy-clients.pxt" acl="system_is_proxy()"/>
</rhn-tab>
<rhn-tab name="Reactivation" url="/network/systems/details/activation.pxt" acl="system_feature(ftr_agent_smith)"/>
<rhn-tab name="Hardware">
commit 65b271f615532d6a6d33eeeaff0fdda0b91db46a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Sep 30 16:08:19 2011 +0200
Make the pxt Connection acl match the java version -- new acl org_has_proxies.
diff --git a/web/html/nav/system_detail.xml b/web/html/nav/system_detail.xml
index b590f12..ff54fb1 100644
--- a/web/html/nav/system_detail.xml
+++ b/web/html/nav/system_detail.xml
@@ -7,7 +7,7 @@
<rhn-tab name="Remote Command" acl="system_feature(ftr_remote_command)">
<rhn-tab-url>/network/systems/details/remote_commands.pxt</rhn-tab-url>
</rhn-tab>
- <rhn-tab name="Connection" url="/network/systems/details/connection.pxt" acl="org_proxy_evr_at_least(3.1-1)"/>
+ <rhn-tab name="Connection" url="/network/systems/details/connection.pxt" acl="org_has_proxies()"/>
<rhn-tab name="Proxy" url="/network/systems/details/proxy.pxt" acl="user_role(org_admin); system_feature(ftr_proxy_capable); org_channel_family(rhn-proxy); child_channel_candidate(rhn-proxy); org_entitlement(rhn_provisioning); not system_is_satellite(); not is_solaris();system_feature(ftr_kickstart) or system_feature(ftr_snapshotting)">
<rhn-tab name="Activation" url="/network/systems/details/proxy.pxt" />
<rhn-tab name="Systems Using Proxy" url="/network/systems/details/proxy-clients.pxt" acl="system_is_proxy();proxy_evr_at_least(3.1-1)"/>
diff --git a/web/modules/rhn/RHN/Access/System.pm b/web/modules/rhn/RHN/Access/System.pm
index 4dde51f..d197b8b 100644
--- a/web/modules/rhn/RHN/Access/System.pm
+++ b/web/modules/rhn/RHN/Access/System.pm
@@ -38,6 +38,7 @@ sub register_acl_handlers {
$acl->register_handler(system_profile_capable => \&system_profile_capable);
$acl->register_handler(proxy_evr_at_least => \&proxy_evr_at_least);
$acl->register_handler(org_proxy_evr_at_least => \&org_proxy_evr_at_least);
+ $acl->register_handler(org_has_proxies => \&org_has_proxies);
$acl->register_handler(package_available => \&package_available_to_system);
$acl->register_handler(action_pending_named => \&action_pending_named);
$acl->register_handler(last_action_attempt_failed => \&last_action_attempt_failed);
@@ -168,6 +169,20 @@ sub org_proxy_evr_at_least {
return 0;
}
+# Return true if the org has at least one registered proxy
+sub org_has_proxies {
+ my $pxt = shift;
+
+ my $ds = new RHN::DataSource::System (-mode => 'org_proxy_servers');
+ my $data = $ds->execute_query(-org_id => $pxt->user->org_id);
+
+ if (@{$data}) {
+ return 1;
+ }
+
+ return 0;
+}
+
# Given a string of the form 'version-release(:epoch)', return an
# array of (epoch, version, release)
sub version_string_to_evr_array {
11 years, 8 months