Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Cobbler does not store values correctly in a profile's Kickstart Metadata #304

Closed
jkugler opened this Issue · 7 comments

3 participants

@jimi-c
Owner

As you noted, you need to either quote things correctly or escape the spaces. Cobbler uses the python shlex library (http://docs.python.org/library/shlex.html) to split up the kopts/ksmeta fields, so you need to quote the string properly for it to be parsed.

With escapes:

$ cobbler system edit --name=test --ksmeta="chef_args=-r\ http://192.168.0.1/cobbler/localmirror/chef_cookbooks/jk_cookbooks.tar.gz\ -j\ http://192.168.0.1/cobbler/localmirror/chef_cookbooks/jk_toro_test_node.json"

$ cobbler system report --name=test | grep "Kickstart Meta" 
Kickstart Metadata             : {'chef_args': '-r http://192.168.0.1/cobbler/localmirror/chef_cookbooks/jk_cookbooks.tar.gz -j http://192.168.0.1/cobbler/localmirror/chef_cookbooks/jk_toro_test_node.json'}

@jimi-c jimi-c closed this
@jkugler

OK, that's a valid reason. However, when it displays it again, it doesn't have the quotes, so if you hit save on the profile, it is then messed up. The user shouldn't have to put quotes around the value every time they hit save if they haven't changed anything in the field.

@jimi-c
Owner

Ahh I see, this is in the web GUI. That would be an issue.

@jimi-c jimi-c reopened this
@jimi-c jimi-c was assigned
@jkugler

Started typing this before you reopened, but still curious:

Another question (since I don't know much about kopts/ksmeta fields): is this really necessary or correct? Are ptions in those fields are not going to behave like shell commands? Are they going to have the same semantics? Would my use case provide an argument that applying shlex to that field can break some use cases?

@jimi-c jimi-c referenced this issue from a commit in jimi-c/cobbler
@jimi-c jimi-c BUGFIX - Issue #304 - Cobbler does not store values correctly for ksmeta
Objects were getting flattened improperly, so it was losing escapes/quoting for values with spaces
a332830
@jimi-c
Owner

Take a look at the above patch and see if that works for you. It seems pretty solid in my testing, so I've merged it into the master branch.

@jimi-c jimi-c referenced this issue from a commit
@jimi-c jimi-c BUGFIX - Issue #304 - Cobbler does not store values correctly for ksmeta
Objects were getting flattened improperly, so it was losing escapes/quoting for values with spaces
cd81b5e
@jmaas
Owner

A year old; no feedback. Assuming all is good now. Closing this issue.

@jmaas jmaas closed this
@jkugler

We have never had a chance to test the most recent version. Is there not a unit test to verify this, or some such?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.