A FAQ that I have brought up on numerous occasions on IRC involves 'getting rid of bad cobbler metavariables'.
If I were to set a wrong ks_meta variable NAME, how do I get rid of the NAME without taking out ks_meta entirely.
E.g.
`cobbler system add --name=NAME --ksmeta='arg0=val0 arg1=val1 *art2*=val2 ... argN=valN' ...`
There are quite a number of scenarios where I don't want to remove all of ksmeta, but only a mistyped variable name. I have heard about the '!ARG' syntax:
E.g.
`cobbler system edit --in-place --name=NAME --ksmeta='*!art2*'`
Supposedly this syntax will, upon deserialization of the JSON, clear the ks_meta namespace of *art2*; however, upon issuing a report on a given entity, the flawed variable will still appear along with the negated variable.
I.e.
ks_meta : 'arg0=val0 arg1=val1 *art2*=*val2* ... argN=valN *!art2*'
For those who make use of this data for inventory or other purposes, the '!VAR' notation does not cut it. I would like a definitive explanation of how to remove bad metavariables irrespective of deserialization.
Thanks,
- A.
Adam Rosenwald wrote:
A FAQ that I have brought up on numerous occasions on IRC involves 'getting rid of bad cobbler metavariables'.
If I were to set a wrong ks_meta variable NAME, how do I get rid of the NAME without taking out ks_meta entirely.
I suspect this is not well documented, though it's been present for a while:
cobbler system edit --name=foo --ksmeta="~NAME" --in-place
replacing "NAME" with the key you want to delete.
(Or, if this is too cryptic to remember, you can also use the web app)
`cobbler system edit --in-place --name=NAME --ksmeta='*!art2*'`
Supposedly this syntax will, upon deserialization of the JSON, clear the ks_meta namespace of *art2*; however, upon issuing a report on a given entity, the flawed variable will still appear along with the negated variable.
That's not about deserialization, that's why... it's about supression of evaluation.
What it means is that when evaluating the object chain the variable will be discarded.
For instance, if the distro sets kernel option "a=2", and the profile sets "!a", there will be no value a in the evaluated kernel options when installing based on that profile.
A better usage example if if globally in settings the kernel arguments included "text" and someone wanted to always do a graphical install for a particular profile:
cobbler profile edit --name=foo --kopts="!text"
--Michael
On Mon, 29 Jun 2009 15:44:24 -0400, Michael DeHaan mdehaan@redhat.com wrote:
Adam Rosenwald wrote:
A FAQ that I have brought up on numerous occasions on IRC involves 'getting rid of bad cobbler metavariables'.
If I were to set a wrong ks_meta variable NAME, how do I get rid of the NAME without taking out ks_meta entirely.
I suspect this is not well documented, though it's been present for a while:
cobbler system edit --name=foo --ksmeta="~NAME" --in-place
replacing "NAME" with the key you want to delete.
(Or, if this is too cryptic to remember, you can also use the web app)
Yeah, this was never added to the man page. I started to update that a while back, but it got lost in the shuffle.
Hello all!
Have a little problem here :( when I run 'cobbler profile dumpvars f12-x86_64' the following error occurs:
Traceback (most recent call last): File "/usr/bin/cobbler", line 35, in <module> sys.exit(app.main()) File "/usr/lib/python2.5/site-packages/cobbler/cli.py", line 501, in main rc = cli.run(sys.argv) File "/usr/lib/python2.5/site-packages/cobbler/cli.py", line 188, in run self.object_command(object_type, object_action) File "/usr/lib/python2.5/site-packages/cobbler/cli.py", line 264, in object_command data = self.remote.get_blended_data(options.name,"") File "/usr/lib/python2.5/xmlrpclib.py", line 1150, in __call__ return self.__send(self.__name, args) File "/usr/lib/python2.5/xmlrpclib.py", line 1434, in __request allow_none=self.__allow_none) File "/usr/lib/python2.5/xmlrpclib.py", line 1083, in dumps data = m.dumps(params) File "/usr/lib/python2.5/xmlrpclib.py", line 623, in dumps dump(v, write) File "/usr/lib/python2.5/xmlrpclib.py", line 638, in __dump f(self, value, write) File "/usr/lib/python2.5/xmlrpclib.py", line 642, in dump_nil raise TypeError, "cannot marshal None unless allow_none is enabled" TypeError: cannot marshal None unless allow_none is enabled
The only 'None' in the profile is for Repos when viewed via cobber_web, command line reports
Name : rescue-f9-i386 Comment : DHCP Tag : default Distribution : f9-i386 Enable PXE Menu? : True Kernel Options : {'rescue': '~'} Kernel Options (Post Install) : {} Kickstart : /var/lib/cobbler/kickstarts/pxerescue.ks Kickstart Metadata : {} Management Classes : [] Name Servers : [] Name Servers Search Path : [] Owners : ['admin'] Red Hat Management Key : <<inherit>> Red Hat Management Server : <<inherit>> Repos : [] Server Override : <<inherit>> Template Files : {} Virt Auto Boot : 1 Virt Bridge : br9 Virt CPUs : 1 Virt File Size(GB) : 10 Virt Path : Virt RAM (MB) : 512 Virt Type : qemu
-Ron
Just checking back, have not heard anything regarding my initial post
-Ron Ronald J. Yacketta wrote:
Hello all!
Have a little problem here :( when I run 'cobbler profile dumpvars f12-x86_64' the following error occurs:
Traceback (most recent call last): File "/usr/bin/cobbler", line 35, in <module> sys.exit(app.main()) File "/usr/lib/python2.5/site-packages/cobbler/cli.py", line 501, in main rc = cli.run(sys.argv) File "/usr/lib/python2.5/site-packages/cobbler/cli.py", line 188, in run self.object_command(object_type, object_action) File "/usr/lib/python2.5/site-packages/cobbler/cli.py", line 264, in object_command data = self.remote.get_blended_data(options.name,"") File "/usr/lib/python2.5/xmlrpclib.py", line 1150, in __call__ return self.__send(self.__name, args) File "/usr/lib/python2.5/xmlrpclib.py", line 1434, in __request allow_none=self.__allow_none) File "/usr/lib/python2.5/xmlrpclib.py", line 1083, in dumps data = m.dumps(params) File "/usr/lib/python2.5/xmlrpclib.py", line 623, in dumps dump(v, write) File "/usr/lib/python2.5/xmlrpclib.py", line 638, in __dump f(self, value, write) File "/usr/lib/python2.5/xmlrpclib.py", line 642, in dump_nil raise TypeError, "cannot marshal None unless allow_none is enabled" TypeError: cannot marshal None unless allow_none is enabled
The only 'None' in the profile is for Repos when viewed via cobber_web, command line reports
Name : rescue-f9-i386 Comment : DHCP Tag : default Distribution : f9-i386 Enable PXE Menu? : True Kernel Options : {'rescue': '~'} Kernel Options (Post Install) : {} Kickstart : /var/lib/cobbler/kickstarts/pxerescue.ks Kickstart Metadata : {} Management Classes : [] Name Servers : [] Name Servers Search Path : [] Owners : ['admin'] Red Hat Management Key : <<inherit>> Red Hat Management Server : <<inherit>> Repos : [] Server Override : <<inherit>> Template Files : {} Virt Auto Boot : 1 Virt Bridge : br9 Virt CPUs : 1 Virt File Size(GB) : 10 Virt Path : Virt RAM (MB) : 512 Virt Type : qemu
-Ron
cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
Ronald J. Yacketta wrote:
Just checking back, have not heard anything regarding my initial post
-Ron Ronald J. Yacketta wrote:
Hello all!
Have a little problem here :( when I run 'cobbler profile dumpvars f12-x86_64' the following error occurs:
Are you sure about the syntax in your command? Try this: cobbler profile dumpvars --name='f12-x86_64'
Adam Rosenwald wrote:
A FAQ that I have brought up on numerous occasions on IRC involves 'getting rid of bad cobbler metavariables'.
If I were to set a wrong ks_meta variable NAME, how do I get rid of the NAME without taking out ks_meta entirely.
I suspect this is not well documented, though it's been present for a while:
cobbler system edit --name=foo --ksmeta="~NAME" --in-place
replacing "NAME" with the key you want to delete.
(Or, if this is too cryptic to remember, you can also use the web app)
`cobbler system edit --in-place --name=NAME --ksmeta='*!art2*'`
Supposedly this syntax will, upon deserialization of the JSON, clear the ks_meta namespace of *art2*; however, upon issuing a report on a given entity, the flawed variable will still appear along with the negated variable.
That's not about deserialization, that's why... it's about supression of evaluation.
What it means is that when evaluating the object chain the variable will be discarded.
For instance, if the distro sets kernel option "a=2", and the profile sets "!a", there will be no value a in the evaluated kernel options when installing based on that profile.
A better usage example if if globally in settings the kernel arguments included "text" and someone wanted to always do a graphical install for a particular profile:
cobbler profile edit --name=foo --kopts="!text"
Thanks for clearing up the distinction between 'suppression of evaluation' vs 'deserialization'. I wasn't quite sure how the '~' or '!' prefix applied to kernel options/kickstart variables when being parsed by anaconda. If the variables are not thrown out during deserialization, then the '!' or '~' prefixes /do/ in fact have meaning for the anaconda parser (unless cobbler does additional processing before the variables are passed to anaconda's parser). Is there a distinction between the '~' or '!' prefixes?
My original question, however, relates to whether and how removing the kopts/ksmeta variables can be achieved, such that they are completely gone -- obliterated from serialized JSON files. No trace of them whatsoever in cobbler hashes. Is there currently a way to do this via the CLI? If not, do you have any objection to my submitting patches on cobbler-devel?
Thanks,
- A.
--Michael
_______________________________________________ cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
Thanks for clearing up the distinction between 'suppression of evaluation' vs 'deserialization'. I wasn't quite sure how the '~' or '!' prefix applied to kernel options/kickstart variables when being parsed by anaconda. If the variables are not thrown out during deserialization, then the '!' or '~' prefixes /do/ in fact have meaning for the anaconda parser (unless cobbler does additional processing before the variables are passed to anaconda's parser). Is there a distinction between the '~' or '!' prefixes?
Yes, ! suppresses the meta variable from being used by Cheetah, ~ deletes it from the list. Be sure to use --in-place when doing this, otherwise you will erase all meta variables. The ~ also works in kopts, kopts-post, etc.
My original question, however, relates to whether and how removing the kopts/ksmeta variables can be achieved, such that they are completely gone -- obliterated from serialized JSON files. No trace of them whatsoever in cobbler hashes. Is there currently a way to do this via the CLI? If not, do you have any objection to my submitting patches on cobbler-devel?
Thanks,
- A.
--Michael
cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
On Sun, Jun 28, 2009 at 03:24:01PM -0500, James Cammarata wrote:
Yes, ! suppresses the meta variable from being used by Cheetah, ~ deletes it from the list. Be sure to use --in-place when doing this, otherwise you will erase all meta variables. The ~ also works in kopts, kopts-post, etc.
Any idea on why deletion doesnt work here?
# cobbler system edit --name=chhorn_tester3 --ksmeta='aaa bbb ccc' # cobbler system report --name=chhorn_tester3|grep meta ks metadata : {'aaa': None, 'bbb': None, 'ccc': None} # cobbler system edit --name=chhorn_tester3 --in-place --ksmeta='~aaa' # cobbler system report --name=chhorn_tester3|grep meta ks metadata : {'aaa': None, 'bbb': None, 'ccc': None, '~aaa': None} # rpm -q cobbler cobbler-1.6.6-1.el5
This is on rhel5 amd64.
Until today usual ksmeta edit cyle was - output current values - set all the new ones including changed ones with 'cobbler system edit'
Christian
Christian Horn wrote:
On Sun, Jun 28, 2009 at 03:24:01PM -0500, James Cammarata wrote:
Yes, ! suppresses the meta variable from being used by Cheetah, ~ deletes it from the list. Be sure to use --in-place when doing this, otherwise you will erase all meta variables. The ~ also works in kopts, kopts-post, etc.
Any idea on why deletion doesnt work here?
# cobbler system edit --name=chhorn_tester3 --ksmeta='aaa bbb ccc'
# cobbler system report --name=chhorn_tester3|grep meta ks metadata : {'aaa': None, 'bbb': None, 'ccc': None}
# cobbler system edit --name=chhorn_tester3 --in-place --ksmeta='~aaa'
# cobbler system report --name=chhorn_tester3|grep meta ks metadata : {'aaa': None, 'bbb': None, 'ccc': None, '~aaa': None}
No, I don't... Works for me (though I'm using HEAD):
[mdehaan@mdehaan src]$ sudo cobbler system edit --name=system1 --ksmeta="aaa=bbb ccc=ddd" [mdehaan@mdehaan src]$ sudo cobbler system edit --name=system1 --ksmeta="~aaa ccc=eee" --in-place [mdehaan@mdehaan src]$ sudo cobbler system report | grep Kick Kickstart Metadata : {'ccc': 'eee'}
Given this works on devel and it's a relatively minor feature we can just fix wait for devel if neccessary, though I don't think the functionality changed between the two. This is just a CLI convention so the API and Web App don't need the above trick to remove a value.
# rpm -q cobbler cobbler-1.6.6-1.el5
This is on rhel5 amd64.
Until today usual ksmeta edit cyle was
- output current values
- set all the new ones including changed ones with 'cobbler system edit'
Christian _______________________________________________ cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
On Tue, 30 Jun 2009 10:24:03 -0400, Michael DeHaan mdehaan@redhat.com wrote:
Christian Horn wrote:
On Sun, Jun 28, 2009 at 03:24:01PM -0500, James Cammarata wrote:
Yes, ! suppresses the meta variable from being used by Cheetah, ~ deletes it from the list. Be sure to use --in-place when doing this, otherwise you will erase all meta variables. The ~ also works in kopts, kopts-post, etc.
Any idea on why deletion doesnt work here?
# cobbler system edit --name=chhorn_tester3 --ksmeta='aaa bbb ccc'
# cobbler system report --name=chhorn_tester3|grep meta ks metadata : {'aaa': None, 'bbb': None, 'ccc': None}
# cobbler system edit --name=chhorn_tester3 --in-place --ksmeta='~aaa'
# cobbler system report --name=chhorn_tester3|grep meta ks metadata : {'aaa': None, 'bbb': None, 'ccc': None, '~aaa': None}
No, I don't... Works for me (though I'm using HEAD):
Did we backport this into release16? I don't think we did (and a quick look at the code seems to confirm this). So it's not broken, this was a new feature that was added to devel only a while back. It just seems like it was added to the main branch a long time ago because we've been working on so many major changes for 2.0.
James Cammarata wrote:
On Tue, 30 Jun 2009 10:24:03 -0400, Michael DeHaan mdehaan@redhat.com wrote:
Christian Horn wrote:
On Sun, Jun 28, 2009 at 03:24:01PM -0500, James Cammarata wrote:
Yes, ! suppresses the meta variable from being used by Cheetah, ~ deletes it from the list. Be sure to use --in-place when doing this, otherwise you will erase all meta variables. The ~ also works in kopts, kopts-post, etc.
Any idea on why deletion doesnt work here?
# cobbler system edit --name=chhorn_tester3 --ksmeta='aaa bbb ccc'
# cobbler system report --name=chhorn_tester3|grep meta ks metadata : {'aaa': None, 'bbb': None, 'ccc': None}
# cobbler system edit --name=chhorn_tester3 --in-place --ksmeta='~aaa'
# cobbler system report --name=chhorn_tester3|grep meta ks metadata : {'aaa': None, 'bbb': None, 'ccc': None, '~aaa': None}
No, I don't... Works for me (though I'm using HEAD):
Did we backport this into release16? I don't think we did (and a quick look at the code seems to confirm this). So it's not broken, this was a new feature that was added to devel only a while back. It just seems like it was added to the main branch a long time ago because we've been working on so many major changes for 2.0.
Most likely, in which case, look for this in the next major release!
--Michael
On Tue, Jun 30, 2009 at 11:51:26AM -0400, Michael DeHaan wrote:
James Cammarata wrote:
On Tue, 30 Jun 2009 10:24:03 -0400, Michael DeHaan mdehaan@redhat.com wrote:
Christian Horn wrote:
Any idea on why deletion doesnt work here?
# cobbler system edit --name=chhorn_tester3 --in-place --ksmeta='~aaa'
No, I don't... Works for me (though I'm using HEAD):
Did we backport this into release16? I don't think we did (and a quick look at the code seems to confirm this). So it's not broken, this was a new feature that was added to devel only a while back. It just seems like it was added to the main branch a long time ago because we've been working on so many major changes for 2.0.
Most likely, in which case, look for this in the next major release!
Ah pretty much explains, good feature to wait for :)
Christian
Thanks for clearing up the distinction between 'suppression of evaluation' vs 'deserialization'. I wasn't quite sure how the '~' or '!' prefix applied to kernel options/kickstart variables when being parsed by anaconda. If the variables are not thrown out during deserialization, then the '!' or '~' prefixes /do/ in fact have meaning for the anaconda parser (unless cobbler does additional processing before the variables are passed to anaconda's parser). Is there a distinction between the '~' or '!' prefixes?
Try to avoid saying "deserialization" here if you can. This isn't the development list, and I don't want folks to feel like they have to understand what that means :) Actually you mean "serialization", that is, when the files are saved. (Further, we also don't want folks to have to know the JSON files exist either... the on-disk format isn't terribly important and the idea is folks do everything via Cobbler).
(A) "~option" -- Delete this immediately from the internal saved state... In other words, I put a value here and now I want to delete it and pretend I never put that value there. Also, I don't want to use the web app to do it. This would remove the value from the internel saved state. (B) "!option" -- I know something higher up is going to define option, and I want to pretend as if they didn't set it, so document the absense of this flag there and make it not be applied. (This is understandably complex)
Both syntaxes are odd mainly because there wasn't a cleaner way to do the syntax without introducing another flag, and we /really/ didn't want to do that.
My original question, however, relates to whether and how removing the kopts/ksmeta variables can be achieved, such that they are completely gone -- obliterated from serialized JSON files. No trace of them whatsoever in cobbler hashes. Is there currently a way to do this via the CLI? If not, do you have any objection to my submitting patches on cobbler-devel?
Yes with "~option".
Thanks, Michael and James!
Thanks for clearing up the distinction between 'suppression of evaluation' vs 'deserialization'. I wasn't quite sure how the '~' or '!' prefix applied to kernel options/kickstart variables when being parsed by anaconda. If the variables are not thrown out during deserialization, then the '!' or '~' prefixes /do/ in fact have meaning for the anaconda parser (unless cobbler does additional processing before the variables are passed to anaconda's parser). Is there a distinction between the '~' or '!' prefixes?
Try to avoid saying "deserialization" here if you can. This isn't the development list, and I don't want folks to feel like they have to understand what that means :) Actually you mean "serialization", that is, when the files are saved. (Further, we also don't want folks to have to know the JSON files exist either... the on-disk format isn't terribly important and the idea is folks do everything via Cobbler).
OK. I will post /advanced-use/ questions in cobbler-devel...
... Although I /did/ mean to say 'deserialization'. ;)
(A) "~option" -- Delete this immediately from the internal saved state... In other words, I put a value here and now I want to delete it and pretend I never put that value there. Also, I don't want to use the web app to do it. This would remove the value from the internel saved state. (B) "!option" -- I know something higher up is going to define option, and I want to pretend as if they didn't set it, so document the absense of this flag there and make it not be applied. (This is understandably complex)
Both syntaxes are odd mainly because there wasn't a cleaner way to do the syntax without introducing another flag, and we /really/ didn't want to do that.
My original question, however, relates to whether and how removing the kopts/ksmeta variables can be achieved, such that they are completely gone -- obliterated from serialized JSON files. No trace of them whatsoever in cobbler hashes. Is there currently a way to do this via the CLI? If not, do you have any objection to my submitting patches on cobbler-devel?
Yes with "~option".
Great explanation. I appreciate it.
If I have any follow-ups, I'll catch you on #cobbler or cobbler-devel mailing list.
Thanks,
- A.
cobbler@lists.fedorahosted.org