FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 07-02-2010, 12:57 PM
Ales Kozumplik
 
Default repo: new parameter '--trustedssl'.

---
pykickstart/commands/repo.py | 26 ++++++++++++++++++++++++++
pykickstart/handlers/control.py | 8 ++++----
tests/commands/repo.py | 9 +++++++++
3 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/pykickstart/commands/repo.py b/pykickstart/commands/repo.py
index 521aeb3..933cbc7 100644
--- a/pykickstart/commands/repo.py
+++ b/pykickstart/commands/repo.py
@@ -108,6 +108,22 @@ class F13_RepoData(F11_RepoData):

return retval

+class RHEL6_RepoData(F13_RepoData):
+ removedKeywords = F13_RepoData.removedKeywords
+ removedAttrs = F13_RepoData.removedAttrs
+
+ def __init__(self, *args, **kwargs):
+ F13_RepoData.__init__(self, *args, **kwargs)
+ self.trustedssl = kwargs.get("trustedssl", False)
+
+ def _getArgsAsStr(self):
+ retval = F13_RepoData._getArgsAsStr(self)
+
+ if self.trustedssl:
+ retval += " --trustedssl"
+
+ return retval
+
class FC6_Repo(KickstartCommand):
removedKeywords = KickstartCommand.removedKeywords
removedAttrs = KickstartCommand.removedAttrs
@@ -209,3 +225,13 @@ class F13_Repo(F11_Repo):
op = F11_Repo._getParser(self)
op.add_option("--proxy")
return op
+
+class RHEL6_Repo(F13_Repo):
+ removedKeywords = F13_Repo.removedKeywords
+ removedAttrs = F13_Repo.removedAttrs
+
+ def _getParser(self):
+ op = F13_Repo._getParser(self)
+ op.add_option("--trustedssl", action="store_true", default=False)
+ return op
+
diff --git a/pykickstart/handlers/control.py b/pykickstart/handlers/control.py
index fd8860e..23a5a77 100644
--- a/pykickstart/handlers/control.py
+++ b/pykickstart/handlers/control.py
@@ -691,7 +691,7 @@ commandMap = {
"poweroff": reboot.FC6_Reboot,
"raid": raid.F14_Raid,
"reboot": reboot.FC6_Reboot,
- "repo": repo.F13_Repo,
+ "repo": repo.RHEL6_Repo,
"rescue": rescue.F10_Rescue,
"rootpw": rootpw.F8_RootPw,
"selinux": selinux.FC3_SELinux,
@@ -912,7 +912,7 @@ commandMap = {
"poweroff": reboot.FC6_Reboot,
"raid": raid.F13_Raid,
"reboot": reboot.FC6_Reboot,
- "repo": repo.F13_Repo,
+ "repo": repo.RHEL6_Repo,
"rescue": rescue.F10_Rescue,
"rootpw": rootpw.F8_RootPw,
"selinux": selinux.FC3_SELinux,
@@ -1103,7 +1103,7 @@ dataMap = {
"NetworkData": network.F8_NetworkData,
"PartData": partition.F14_PartData,
"RaidData": raid.F14_RaidData,
- "RepoData": repo.F13_RepoData,
+ "RepoData": repo.RHEL6_RepoData,
"SshPwData": sshpw.F13_SshPwData,
"UserData": user.F12_UserData,
"VolGroupData": volgroup.FC3_VolGroupData,
@@ -1153,7 +1153,7 @@ dataMap = {
"NetworkData": network.F8_NetworkData,
"PartData": partition.F12_PartData,
"RaidData": raid.F13_RaidData,
- "RepoData": repo.F13_RepoData,
+ "RepoData": repo.RHEL6_RepoData,
"SshPwData": sshpw.F13_SshPwData,
"UserData": user.F12_UserData,
"VolGroupData": volgroup.FC3_VolGroupData,
diff --git a/tests/commands/repo.py b/tests/commands/repo.py
index 06a3a9b..27c3140 100644
--- a/tests/commands/repo.py
+++ b/tests/commands/repo.py
@@ -98,5 +98,14 @@ class F13_TestCase(F11_TestCase):
self.assert_parse_error("repo --name=blah --baseurl=www.domain.com --proxy",
KickstartParseError)

+class RHEL6_TestCase(F13_TestCase):
+ def runTest(self):
+ F13_TestCase.runTest(self)
+ #pass
+ self.assert_parse("repo --name=blah --baseurl=https://www.domain.com --trustedssl")
+ #fail
+ self.assert_parse_error("repo --name=blah --baseurl=https://www.domain.com --trustedssl=yeeeaah", KickstartParseError)
+
+
if __name__ == "__main__":
unittest.main()
--
1.7.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-02-2010, 10:17 PM
"Brian C. Lane"
 
Default repo: new parameter '--trustedssl'.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/02/2010 05:57 AM, Ales Kozumplik wrote:
> +
> +class RHEL6_Repo(F13_Repo):
> + removedKeywords = F13_Repo.removedKeywords
> + removedAttrs = F13_Repo.removedAttrs
> +
> + def _getParser(self):
> + op = F13_Repo._getParser(self)
> + op.add_option("--trustedssl", action="store_true", default=False)
> + return op
> +

Shouldn't this be:

op.add_option("--trustedssl", action="store", type="ksboolean")

instead? That matches the F11 --ignoregroups option and would be
consistent. That also means that it needs to be passed an =true instead
of being bare.

I do notice that the wiki documentation for --ignoregroups isn't
complete, so I'll fix that now.

- --
Brian C. Lane <bcl@redhat.com>
Red Hat / Port Orchard, WA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEVAwUBTC5lbBF+jBaO/jp/AQJD6QgAn30HNrB41gHk/zjoNs8GH4Zj/n1pc99l
COOTSp8FSiO15n91gacqPt9c92nHsFzSMeVL5Cf4bWT6BVRsBB SSs872dKSZ2Ier
NhHCbHPUrH6LjpB7LQilQscGdNAGypi74LKoOH6EMnPDbJnWjc ENBLdEQcfaA9/B
/KDo1fP/H+IWgIJDwCEUujWn7eeHLTXQT9je1sxD8ibtMAVDtxRh99A0+Y R8mBUm
y6Y+rakeSF1f/Xn+htHWAbtfwEkKY7NILwfT/8P2EKZ3/dnal8GW9ts/6XHQKqnS
7QAXq1CKgCT6jPHmtpgzsCsjtZGQzqP8ExUbHs1j3txZKN/KQF9qIA==
=UZI4
-----END PGP SIGNATURE-----

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-07-2010, 06:14 AM
Ales Kozumplik
 
Default repo: new parameter '--trustedssl'.

Hi,

On 07/03/2010 12:17 AM, Brian C. Lane wrote:

Shouldn't this be:

op.add_option("--trustedssl", action="store", type="ksboolean")

instead? That matches the F11 --ignoregroups option and would be
consistent. That also means that it needs to be passed an =true instead
of being bare.


But we use store_true a lot in pykickstart. And I think it's good one
doesn't have to ues =true etc. with it, i.e. the connection is not
trusted by default. See '--noipv4' in network.py for instance.




I do notice that the wiki documentation for --ignoregroups isn't
complete, so I'll fix that now.


That reminds me I shouldn't forget to update the wiki once this is pushed.

Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-07-2010, 02:07 PM
Chris Lumens
 
Default repo: new parameter '--trustedssl'.

> op.add_option("--trustedssl", action="store", type="ksboolean")
>
> instead? That matches the F11 --ignoregroups option and would be
> consistent. That also means that it needs to be passed an =true instead
> of being bare.

ksboolean is only if you want to use 1/0/Yes/No/On/Off as values. It
shouldn't really be used for new things if we can help it. I only added
it because a million years ago, kickstart supported those values and now
I'm stuck with it.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-07-2010, 02:11 PM
Chris Lumens
 
Default repo: new parameter '--trustedssl'.

> diff --git a/tests/commands/repo.py b/tests/commands/repo.py
> index 06a3a9b..27c3140 100644
> --- a/tests/commands/repo.py
> +++ b/tests/commands/repo.py
> @@ -98,5 +98,14 @@ class F13_TestCase(F11_TestCase):
> self.assert_parse_error("repo --name=blah --baseurl=www.domain.com --proxy",
> KickstartParseError)
>
> +class RHEL6_TestCase(F13_TestCase):
> + def runTest(self):
> + F13_TestCase.runTest(self)
> + #pass
> + self.assert_parse("repo --name=blah --baseurl=https://www.domain.com --trustedssl")
> + #fail
> + self.assert_parse_error("repo --name=blah --baseurl=https://www.domain.com --trustedssl=yeeeaah", KickstartParseError)
> +
> +
> if __name__ == "__main__":
> unittest.main()

Thanks for adding test cases. I'd also like you to add a test case to
verify that if you pass --trustedssl as a parameter, you also get it on
the output side as well. You can do that by passing a second argument
to assert_parse. See tests/commands/authconfig.py for an example.

I assume you also ran "make test" and "make check" to verify everything
works?

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 12:12 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org