[PATCH] #576 fix calc_kernel_args in koan
by Chris Ess
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
When I ran koan (version 2.0.3.1) to create a VM, it failed in
calc_kernel_args trying to concatenate a string to a dictionary. The
last error was:
File "/usr/lib/python2.4/site-packages/koan/app.py", line 1050, in
calc_kernel_args
kextra = kextra + " " + options
(The full error is in the ticket posted on Trac.)
It looks like safe_load for kernel_options used to return a string but
at some point changed to a dictionary.
Originally, I implemented a workaround by changing the line to:
kextra = kextra + " " + utils.hash_to_string( options )
However, I then noticed this comment in calc_kernel_args below that line:
# convert the from-cobbler options back to a hash
# so that we can override it in a way that works as intended
Since options is now getting set to a dictionary, there doesn't seem to
be a need to translate this to a string and then back again.
The patch attached makes koan work as expected (i.e. I can create VMs
successfully) and removes the need to convert options to a string and
then the concatenated string back to a dictionary. I'm sure further
improvements can be made though so I think of this as just a starting point.
Please let me know if there's anything further you'd like me to do.
Best regards,
Chris Ess
System Administrator / CDTT (Certified Duct Tape Technician)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBCAAGBQJLkgHkAAoJEDjp7N7WGgQ3PfgP/0X6/nzMoCxWNYAf3c3fIDHI
+qtbJb51yw60f2PtaYCqi55P/7GGD9U3mYQF+xtT5vgcqbNu0ttNKLNnyMSlwslp
/RX1AR2X47wKt4uC1rAEimaPWI5bBdNend4TDYzgAqBB26LBhvu89kc52K1/z112
TJ6LLtf3WQmyK07vB1aDKYuTOkvyDrIp74iMbe2AbgsdxTXxclWGa5sPTahdEAUz
deoCfae5Rd6pjVqP6C1NG7LcGCW9HZbdQGn1FbNz0CQlrKenCGHuDqjJMy/eUukj
PH1IaomIqEqYaul8xCwkSxZ/g5JGyaUeV5+VluN68iAWh4ashpuqFvLwf9i3J4Uy
9s3GDbfMn80oUAYmwx+ZZM1S3rokn7n7SYsAwnrSElvGs0xmJwSyappl2BIcAZ3x
wsAxUj9x3pf6lUEUgiV6KF0G4i1aBOF9iId00DaOdvVb/Bi0m45Uy1uk2IruOSnL
5m5QrY4FTCB3Kh+yeWk3ml+sFg/9kdXcXaVV5b3VnYM95U4HAyKjNNY1498orw7I
ARJCQkTHB3afFhQpO9GVX0TeiEfMLUFIi6mUYpu+/Hbwpp6LOcZW7JXiPYv/bsJR
6ElxddC6EcvJySkQB3N/Kkq9rI4m9g98FbGLH8FBBC1On+GpY0LP0MLzr+xpCpWl
KuuG2lBAgcZF3MALK/P/
=NM20
-----END PGP SIGNATURE-----
diff --git a/koan/app.py b/koan/app.py
index f1c5adb..5a51d6a 100755
--- a/koan/app.py
+++ b/koan/app.py
@@ -1036,25 +1036,19 @@ class Koan:
def calc_kernel_args(self, pd, replace_self=0):
kickstart = self.safe_load(pd,'kickstart')
- options = self.safe_load(pd,'kernel_options',default='')
+ options = self.safe_load(pd,'kernel_options',default={})
breed = self.safe_load(pd,'breed')
- kextra = ""
+ hashv = {}
if kickstart is not None and kickstart != "":
if breed is not None and breed == "suse":
- kextra = "autoyast=" + kickstart
+ hashv[ "autoyast" ] = kickstart
else:
- kextra = "ks=" + kickstart
+ hashv[ "ks" ] = kickstart
- if options !="":
- kextra = kextra + " " + options
+ hashv.update( options )
# parser issues? lang needs a trailing = and somehow doesn't have it.
- # convert the from-cobbler options back to a hash
- # so that we can override it in a way that works as intended
-
- hashv = utils.input_string_or_hash(kextra)
-
if self.static_interface is not None and (breed is None or breed == "redhat"):
interface_name = self.static_interface
interfaces = self.safe_load(pd, "interfaces")
14 years, 2 months
Lack of mkinitrd in F13 breaks depsolving
by Garrett Holmstrom
Hi folks,
The mkinitrd package is now completely removed from the Fedora 13 tree,
which breaks dependency solving for koan. I'm having trouble finding
where koan calls it; is it even used any more? If it does still use
mkinitrd, would it be difficult to make it work with dracut when that's
available instead?
--
Garrett Holmstrom
14 years, 2 months
Cobbler 2.0.3 and future development
by Scott Henson
I've released, what expect to be, the first cobbler 2.0 to hit epel
and all of the stable fedora releases. You should see
cobbler-2.0.3.1-3 hit the various repositories in the next day or so.
I intend to start doing monthly stable releases on cobbler 2.0.x till
cobbler 2.2 comes out. As such I've branched a stable branch that
will contain these fixes.
As for cobbler 2.2, development will continue on it. I suspect we
will do a 2.1 release sometime in the next couple months and target
2.2 for the fall sometime. A few things that I suspect will be in 2.2
will be the ipv6 support, and madhatter. I'd also like to clean up
our serializer as well. If anyone has anything else they would like
to include I'm all ears.
As for madhatter, I think it probably needs to be integrated into the
current puppet management classes code. It makes sense to combine the
two of them.
Of course all the above is my personal opinion. If anyone else wants
something different, I'm open to other plans. Thanks for listening to
my rants.
--
Scott Henson
Red Hat CIS Operator
WVU Alum BSAE/BSME
14 years, 2 months