Changes to 'refs/tags/rhn-client-tools-1.10.10-1'
by Jan Dobes
Tag 'rhn-client-tools-1.10.10-1' created by Jan Dobes <jdobes(a)redhat.com> at 2013-06-19 12:50 +0000
Tagging package [rhn-client-tools] version [1.10.10-1] in directory [client/rhel/rhn-client-tools/].
Changes since rhncfg-5.10.52-1:
Jan Dobes (1):
Automatic commit of package [rhn-client-tools] release [1.10.10-1].
---
client/rhel/rhn-client-tools/rhn-client-tools.spec | 5 ++++-
rel-eng/packages/rhn-client-tools | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
---
10 years, 10 months
client/rhel rel-eng/packages
by Jan Dobes
client/rhel/rhn-client-tools/rhn-client-tools.spec | 5 ++++-
rel-eng/packages/rhn-client-tools | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 1be68bf88be8f8edb5016a049cd623dc785c130b
Author: Jan Dobes <jdobes(a)redhat.com>
Date: Wed Jun 19 14:50:37 2013 +0200
Automatic commit of package [rhn-client-tools] release [1.10.10-1].
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index b931d40..89fc35e 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.9
+Version: 1.10.10
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -346,6 +346,9 @@ make -f Makefile.rhn-client-tools test
%endif
%changelog
+* Wed Jun 19 2013 Jan Dobes 1.10.10-1
+- 957506 - unicode support for Remote Command scripts
+
* Mon Jun 17 2013 Tomas Kasparek <tkasparek(a)redhat.com> 1.10.9-1
- rebranding few more strings in client stuff
diff --git a/rel-eng/packages/rhn-client-tools b/rel-eng/packages/rhn-client-tools
index ae64dbe..99d03c8 100644
--- a/rel-eng/packages/rhn-client-tools
+++ b/rel-eng/packages/rhn-client-tools
@@ -1 +1 @@
-1.10.9-1 client/rhel/rhn-client-tools/
+1.10.10-1 client/rhel/rhn-client-tools/
10 years, 10 months
Changes to 'refs/tags/rhncfg-5.10.52-1'
by Jan Dobes
Tag 'rhncfg-5.10.52-1' created by Jan Dobes <jdobes(a)redhat.com> at 2013-06-19 12:47 +0000
Tagging package [rhncfg] version [5.10.52-1] in directory [client/tools/rhncfg/].
Changes since rhncfg-5.10.51-1:
Jan Dobes (2):
957506 - unicode support for Remote Command scripts
Automatic commit of package [rhncfg] release [5.10.52-1].
Milan Zazrivec (1):
don't create / drop indexes if they exit / don't exist
Tomas Kasparek (1):
852250 - filter out bad package/architecture combinations
---
backend/server/action/packages.py | 2
client/debian/packages-already-in-debian/rhn-client-tools/src/bin/rhn_check.py | 2
client/rhel/rhn-client-tools/src/bin/rhn_check.py | 2
client/tools/rhncfg/actions/script.py | 2
client/tools/rhncfg/rhncfg.spec | 5 +
rel-eng/packages/rhncfg | 2
schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/126-alter-index-rhnCpu.sql | 10 ---
schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/126-alter-index-rhnCpu.sql.oracle | 30 ++++++++++
schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/126-alter-index-rhnCpu.sql.postgresql | 12 ++++
schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/127-alter-index-rhnServerDmi.sql | 10 ---
schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/127-alter-index-rhnServerDmi.sql.oracle | 29 +++++++++
schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/127-alter-index-rhnServerDmi.sql.postgresql | 12 ++++
12 files changed, 93 insertions(+), 25 deletions(-)
---
10 years, 10 months
client/tools rel-eng/packages
by Jan Dobes
client/tools/rhncfg/rhncfg.spec | 5 ++++-
rel-eng/packages/rhncfg | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit b51c2c5210ed8c5dae82b65687d44fa26c8cbad5
Author: Jan Dobes <jdobes(a)redhat.com>
Date: Wed Jun 19 14:47:37 2013 +0200
Automatic commit of package [rhncfg] release [5.10.52-1].
diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index 09b055b..c28cd55 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -8,7 +8,7 @@ Group: Applications/System
License: GPLv2
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.10.51
+Version: 5.10.52
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -121,6 +121,9 @@ fi
# $Id$
%changelog
+* Wed Jun 19 2013 Jan Dobes 5.10.52-1
+- 957506 - unicode support for Remote Command scripts
+
* Tue Jun 18 2013 Dimitar Yordanov <dyordano(a)redhat.com> 5.10.51-1
- 918036 - RFE - rhncfg-manager supports --username and --password from CLI
diff --git a/rel-eng/packages/rhncfg b/rel-eng/packages/rhncfg
index 8d091c0..39aba2e 100644
--- a/rel-eng/packages/rhncfg
+++ b/rel-eng/packages/rhncfg
@@ -1 +1 @@
-5.10.51-1 client/tools/rhncfg/
+5.10.52-1 client/tools/rhncfg/
10 years, 10 months
client/debian client/rhel client/tools
by Jan Dobes
client/debian/packages-already-in-debian/rhn-client-tools/src/bin/rhn_check.py | 2 +-
client/rhel/rhn-client-tools/src/bin/rhn_check.py | 2 +-
client/tools/rhncfg/actions/script.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 2e78b67402369125a49b568c469689dda42a241d
Author: Jan Dobes <jdobes(a)redhat.com>
Date: Wed Jun 19 14:20:28 2013 +0200
957506 - unicode support for Remote Command scripts
diff --git a/client/debian/packages-already-in-debian/rhn-client-tools/src/bin/rhn_check.py b/client/debian/packages-already-in-debian/rhn-client-tools/src/bin/rhn_check.py
index 802b102..ef6609c 100755
--- a/client/debian/packages-already-in-debian/rhn-client-tools/src/bin/rhn_check.py
+++ b/client/debian/packages-already-in-debian/rhn-client-tools/src/bin/rhn_check.py
@@ -201,7 +201,7 @@ class CheckCli(rhncli.RhnCli):
""" Parse action data and returns (method, params) """
data = action['action']
parser, decoder = xmlrpclib.getparser()
- parser.feed(data)
+ parser.feed(data.encode("utf-8"))
parser.close()
params = decoder.close()
method = decoder.getmethodname()
diff --git a/client/rhel/rhn-client-tools/src/bin/rhn_check.py b/client/rhel/rhn-client-tools/src/bin/rhn_check.py
index 1dcad22..6376a01 100755
--- a/client/rhel/rhn-client-tools/src/bin/rhn_check.py
+++ b/client/rhel/rhn-client-tools/src/bin/rhn_check.py
@@ -205,7 +205,7 @@ class CheckCli(rhncli.RhnCli):
""" Parse action data and returns (method, params) """
data = action['action']
parser, decoder = xmlrpclib.getparser()
- parser.feed(data)
+ parser.feed(data.encode("utf-8"))
parser.close()
params = decoder.close()
method = decoder.getmethodname()
diff --git a/client/tools/rhncfg/actions/script.py b/client/tools/rhncfg/actions/script.py
index b729983..06e4d82 100644
--- a/client/tools/rhncfg/actions/script.py
+++ b/client/tools/rhncfg/actions/script.py
@@ -70,7 +70,7 @@ def _create_script_file(script, uid=None, gid=None):
# Tried a couple of times, failed; bail out raising the latest error
raise
sf = os.fdopen(fd, 'w')
- sf.write(script)
+ sf.write(script.encode("utf-8"))
sf.close()
if uid and gid:
10 years, 10 months
backend/server
by Tomáš Kašpárek
backend/server/action/packages.py | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit afce44e050147bfdb8d06423c1cf06352aff5b4f
Author: Tomas Kasparek <tkasparek(a)redhat.com>
Date: Wed Jun 19 12:12:52 2013 +0200
852250 - filter out bad package/architecture combinations
during installing packages (e.g. during registering system with an activation
key with packages to insall with it) with bad combination of package name
and architecture this should be filtered and do not cause an error
with rhn_check -vvvvv
diff --git a/backend/server/action/packages.py b/backend/server/action/packages.py
index da66d5e..23d77a2 100644
--- a/backend/server/action/packages.py
+++ b/backend/server/action/packages.py
@@ -213,6 +213,7 @@ left join rhnPackageArch pa
and ap.evr_id = p.evr_id
and ap.evr_id = pe.id
and ap.name_id = p.name_id
+ and (ap.package_arch_id = p.package_arch_id or ap.package_arch_id is null)
and ap.name_id = pn.id
and p.id = cp.package_id
and cp.channel_id = sc.channel_id
@@ -235,6 +236,7 @@ left join rhnPackageArch pa
and ap.evr_id is null
and ap.name_id = p.name_id
and p.name_id = pn.id
+ and (ap.package_arch_id = p.package_arch_id or ap.package_arch_id is null)
and p.id = cp.package_id
and cp.channel_id = sc.channel_id
and sc.server_id = :serverid"""
10 years, 10 months
schema/spacewalk
by Milan Zazrivec
schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/126-alter-index-rhnCpu.sql | 10 ---
schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/126-alter-index-rhnCpu.sql.oracle | 30 ++++++++++
schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/126-alter-index-rhnCpu.sql.postgresql | 12 ++++
schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/127-alter-index-rhnServerDmi.sql | 10 ---
schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/127-alter-index-rhnServerDmi.sql.oracle | 29 +++++++++
schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/127-alter-index-rhnServerDmi.sql.postgresql | 12 ++++
6 files changed, 83 insertions(+), 20 deletions(-)
New commits:
commit 5c54e1420a65841def4e0fc54a59e0ed9a5683ce
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Wed Jun 19 11:09:45 2013 +0200
don't create / drop indexes if they exit / don't exist
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/126-alter-index-rhnCpu.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/126-alter-index-rhnCpu.sql
deleted file mode 100644
index fa1b37b..0000000
--- a/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/126-alter-index-rhnCpu.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-delete from rhncpu X
- where server_id in (select server_id from rhncpu group by server_id having count(server_id)>1)
- and id<(select max(id) from rhncpu Y where X.server_id=Y.server_id group by server_id having count(server_id)>1);
-
-DROP INDEX rhn_cpu_server_id_idx;
-
-CREATE UNIQUE INDEX rhn_cpu_server_id_uq
- ON rhnCpu (server_id)
- TABLESPACE [[4m_tbs]]
- NOLOGGING;
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/126-alter-index-rhnCpu.sql.oracle b/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/126-alter-index-rhnCpu.sql.oracle
new file mode 100644
index 0000000..6dc1769
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/126-alter-index-rhnCpu.sql.oracle
@@ -0,0 +1,30 @@
+delete from rhncpu X
+ where server_id in (select server_id from rhncpu group by server_id having count(server_id)>1)
+ and id<(select max(id) from rhncpu Y where X.server_id=Y.server_id group by server_id having count(server_id)>1);
+
+set serverout on;
+
+declare
+ non_existent_index exception;
+ pragma exception_init(non_existent_index, -01418);
+begin
+ execute immediate 'drop index rhn_cpu_server_id_idx';
+ dbms_output.put_line('Index rhn_cpu_server_id_idx successfully dropped.');
+exception
+ when non_existent_index then
+ null;
+end;
+/
+
+
+declare
+ name_already_used exception;
+ pragma exception_init(name_already_used, -00955);
+begin
+ execute immediate 'create unique index rhn_cpu_server_id_uq on rhnCpu(server_id) tablespace [[4m_tbs]] nologging';
+ dbms_output.put_line('Index rhn_cpu_server_id_uq successfully created.');
+exception
+ when name_already_used then
+ dbms_output.put_line('Index rhn_cpu_server_id_uq already exists.');
+end;
+/
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/126-alter-index-rhnCpu.sql.postgresql b/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/126-alter-index-rhnCpu.sql.postgresql
new file mode 100644
index 0000000..e933cc0
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/126-alter-index-rhnCpu.sql.postgresql
@@ -0,0 +1,12 @@
+-- oracle equivalent source sha1 4e3db8117396d3b89f2ead45b41c52fc97b61d3b
+
+delete from rhncpu X
+ where server_id in (select server_id from rhncpu group by server_id having count(server_id)>1)
+ and id<(select max(id) from rhncpu Y where X.server_id=Y.server_id group by server_id having count(server_id)>1);
+
+DROP INDEX rhn_cpu_server_id_idx;
+
+CREATE UNIQUE INDEX rhn_cpu_server_id_uq
+ ON rhnCpu (server_id)
+ TABLESPACE [[4m_tbs]]
+ NOLOGGING;
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/127-alter-index-rhnServerDmi.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/127-alter-index-rhnServerDmi.sql
deleted file mode 100644
index 41c7932..0000000
--- a/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/127-alter-index-rhnServerDmi.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-delete from rhnServerDMI X
- where server_id in (select server_id from rhnServerDMI group by server_id having count(server_id)>1)
- and id<(select max(id) from rhnServerDMI Y where X.server_id=Y.server_id group by server_id having count(server_id)>1);
-
-DROP INDEX rhn_server_dmi_sid_idx;
-
-CREATE UNIQUE INDEX rhn_server_dmi_sid_uq
- ON rhnServerDMI (server_id)
- TABLESPACE [[2m_tbs]]
- NOLOGGING;
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/127-alter-index-rhnServerDmi.sql.oracle b/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/127-alter-index-rhnServerDmi.sql.oracle
new file mode 100644
index 0000000..4a57a32
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/127-alter-index-rhnServerDmi.sql.oracle
@@ -0,0 +1,29 @@
+delete from rhnServerDMI X
+ where server_id in (select server_id from rhnServerDMI group by server_id having count(server_id)>1)
+ and id<(select max(id) from rhnServerDMI Y where X.server_id=Y.server_id group by server_id having count(server_id)>1);
+
+set serverout on;
+
+declare
+ non_existent_index exception;
+ pragma exception_init(non_existent_index, -01418);
+begin
+ execute immediate 'drop index rhn_server_dmi_sid_idx';
+ dbms_output.put_line('Index rhn_server_dmi_sid_idx successfully dropped.');
+exception
+ when non_existent_index then
+ null;
+end;
+/
+
+declare
+ name_already_used exception;
+ pragma exception_init(name_already_used, -00955);
+begin
+ execute immediate 'create unique index rhn_server_dmi_sid_uq on rhnServerDMI(server_id) tablespace [[2m_tbs]] nologging';
+ dbms_output.put_line('Index rhn_server_dmi_sid_uq successfully created.');
+exception
+ when name_already_used then
+ dbms_output.put_line('Index rhn_server_dmi_sid_uq already exists.');
+end;
+/
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/127-alter-index-rhnServerDmi.sql.postgresql b/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/127-alter-index-rhnServerDmi.sql.postgresql
new file mode 100644
index 0000000..13ada0d
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/127-alter-index-rhnServerDmi.sql.postgresql
@@ -0,0 +1,12 @@
+-- oracle equivalent source sha1 01275deaf6123ca8a086f1019cf933fe7d2026f7
+
+delete from rhnServerDMI X
+ where server_id in (select server_id from rhnServerDMI group by server_id having count(server_id)>1)
+ and id<(select max(id) from rhnServerDMI Y where X.server_id=Y.server_id group by server_id having count(server_id)>1);
+
+DROP INDEX rhn_server_dmi_sid_idx;
+
+CREATE UNIQUE INDEX rhn_server_dmi_sid_uq
+ ON rhnServerDMI (server_id)
+ TABLESPACE [[2m_tbs]]
+ NOLOGGING;
10 years, 10 months
Changes to 'refs/tags/rhncfg-5.10.51-1'
by Dimitar Yordanov
Tag 'rhncfg-5.10.51-1' created by Dimitar Yordanov <dyordano(a)redhat.com> at 2013-06-18 17:11 +0000
Tagging package [rhncfg] version [5.10.51-1] in directory [client/tools/rhncfg/].
Changes since spacewalk-java-1.10.100-1:
Dimitar Yordanov (3):
815236 - add GNU General Public License
918036 - RFE - rhncfg-manager supports --username and --password from CLI
Automatic commit of package [rhncfg] release [5.10.51-1].
Tomas Kasparek (1):
975083 - typo fix
---
client/tools/rhncfg/config_common/handler_base.py | 10 +-
client/tools/rhncfg/config_common/rhn_main.py | 44 ++++++----
client/tools/rhncfg/rhncfg.spec | 5 -
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 4
rel-eng/packages/rhncfg | 2
web/modules/dobby/scripts/check-database-space-usage.sh | 19 ++--
6 files changed, 52 insertions(+), 32 deletions(-)
---
10 years, 10 months
client/tools rel-eng/packages
by Dimitar Yordanov
client/tools/rhncfg/rhncfg.spec | 5 ++++-
rel-eng/packages/rhncfg | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 96aac010cd1d9ac0dbcca9186bd28a2e01cebab9
Author: Dimitar Yordanov <dyordano(a)redhat.com>
Date: Tue Jun 18 19:11:27 2013 +0200
Automatic commit of package [rhncfg] release [5.10.51-1].
diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index fc4e49b..09b055b 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -8,7 +8,7 @@ Group: Applications/System
License: GPLv2
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.10.50
+Version: 5.10.51
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -121,6 +121,9 @@ fi
# $Id$
%changelog
+* Tue Jun 18 2013 Dimitar Yordanov <dyordano(a)redhat.com> 5.10.51-1
+- 918036 - RFE - rhncfg-manager supports --username and --password from CLI
+
* Mon Jun 17 2013 Michael Mraka <michael.mraka(a)redhat.com> 5.10.50-1
- branding fixes in man pages
- more branding cleanup
diff --git a/rel-eng/packages/rhncfg b/rel-eng/packages/rhncfg
index e4ac6b8..8d091c0 100644
--- a/rel-eng/packages/rhncfg
+++ b/rel-eng/packages/rhncfg
@@ -1 +1 @@
-5.10.50-1 client/tools/rhncfg/
+5.10.51-1 client/tools/rhncfg/
10 years, 10 months
client/tools
by Dimitar Yordanov
client/tools/rhncfg/config_common/handler_base.py | 10 +++--
client/tools/rhncfg/config_common/rhn_main.py | 44 ++++++++++++++--------
2 files changed, 34 insertions(+), 20 deletions(-)
New commits:
commit 02ed29e85029ab6568fb65514a14b02b04bb4e23
Author: Dimitar Yordanov <dyordano(a)redhat.com>
Date: Tue Mar 5 12:48:25 2013 +0100
918036 - RFE - rhncfg-manager supports --username and --password from CLI
diff --git a/client/tools/rhncfg/config_common/handler_base.py b/client/tools/rhncfg/config_common/handler_base.py
index e10c17a..24694fb 100644
--- a/client/tools/rhncfg/config_common/handler_base.py
+++ b/client/tools/rhncfg/config_common/handler_base.py
@@ -53,20 +53,22 @@ class HandlerBase:
def usage(self):
return self._parser.print_help()
- def authenticate(self):
+ def authenticate(self, username=None, password=None):
# entry point for repository authentication
try:
self.repository.login()
except cfg_exceptions.InvalidSession:
- (username, password) = self.get_auth_info(
- username=local_config.get('username'))
+ if not username :
+ username=local_config.get('username')
+ if not password :
+ (username, password) = self.get_auth_info(username)
try:
self.repository.login(username=username, password=password)
except cfg_exceptions.InvalidSession, e:
rhn_log.die(1, "Session error: %s\n" % e)
-
+
def get_auth_info(self, username=None):
if username is None:
username = self._read_username()
diff --git a/client/tools/rhncfg/config_common/rhn_main.py b/client/tools/rhncfg/config_common/rhn_main.py
index f59340b..be6af7c 100644
--- a/client/tools/rhncfg/config_common/rhn_main.py
+++ b/client/tools/rhncfg/config_common/rhn_main.py
@@ -54,27 +54,39 @@ class BaseMain:
show_help = None
debug_level = 3
mode = None
- server_name = None
- server_name_opt = "--server-name"
- needs_server_name = 0
- for arg in sys.argv[1:]:
- if needs_server_name:
- server_name = arg
- needs_server_name = 0
+
+ dict_name_opt={'--server-name': None,'--password': None,'--username': None,}
+ for index in range(1,len(sys.argv)):
+ arg=sys.argv[index]
+ param = filter(lambda x: x[1] == 0,dict_name_opt.iteritems())
+ if param:
+ if arg.startswith('-') or arg in self.modes:
+ # not perfect, but at least a little bit better
+ print "Option %s requires an argument" % dict_name_opt[param[0][0]]
+ return 1
+ dict_name_opt[param[0][0]] = arg
continue
if arg in ('--help', '-h'):
show_help = 1
continue
- if arg.startswith(server_name_opt):
- rarg = arg[len(server_name_opt):]
+ param = [s for s in dict_name_opt.keys() if arg.startswith(s)]
+ if param:
+ rarg = arg[len(param[0]):]
if not rarg:
- needs_server_name = 1
+ dict_name_opt[param[0]] = 0
+ if index == len(sys.argv) - 1:
+ print "Option %s requires an argument" % param[0]
+ return 1
continue
if rarg[0] == '=':
- server_name = rarg[1:]
- continue
+ if len(rarg) == 1:
+ print "Option %s requires an argument" % param[0]
+ return 1
+
+ dict_name_opt[param[0]] = rarg[1:]
+ continue
print "Unknown option %s" % arg
return 1
@@ -97,9 +109,9 @@ class BaseMain:
args.append(arg)
- if needs_server_name:
- print "No argument specified to %s" % server_name_opt
- return 1
+ server_name = dict_name_opt['--server-name']
+ password = dict_name_opt['--password']
+ username = dict_name_opt['--username']
rhn_log.set_debug_level(debug_level)
@@ -191,7 +203,7 @@ class BaseMain:
handler = module.Handler(args, repo, mode=mode, exec_name=execname)
try:
- handler.authenticate()
+ handler.authenticate(username,password)
handler.run()
except cfg_exceptions.AuthenticationError, e:
rhn_log.die(1, "Authentication failed: %s" % e)
10 years, 10 months