Snippet issues with '^M'

Latest response

Greetings,

I've recently been working on building a snippet for our Satellite (5.4.0). I've tested this snippet, and it runs fine as a script and in general. I wrote it with GVim, and committed it to our SVN before updating our KickStart folders. I've validated the snippet, and the kickstart profiles, and everything looks fine.

However when this snippet is called in a kickstart.. the kickstart doesn't work correctly. Several steps past my snippet call are not being done. After some investigation, I've noticed that the post-build cobbler.ks file shows my snippet is full of "^M"s. The problem was that a EOF call for a configuration write was read as EOF^M, and thus didn't close the write. This caused everything else after it to be part of a print function.

I've no explanation as to why they have the ^M (which is a windows carriage return i believe?). They ONLY show up in the cobbler.ks file. The snippet on the satellite server doesn't show them. I've run a dos2unix over this file, and it was never in notepad or anything of the sort.

Anyone have any insight on anything like this?

Thanks,

Denny

Responses

What Desktop OS and Browser are you using when you cut-and-paste the script into the snippet portal on Satellite?

You could view the snippets (and I don't know if this is frowned upon) in /var/lib/cobbler/snippets/spacewalk/1 (where 1 is your ORGID I believe).

There wasn't any cutting and pasting. The snippet was written in GVIM on my windows 7 laptop, and was svn commited via svn tortoise to our SVN repository. Then satellite was svn updated to bring down the added snippet. We use subversion to manage our snippets in Satellite and don't use the gui.

I would also suggest deleting the existing snippet and trying to recreate it on the Satellite server. Try using spacecmd and the 'snippet_create' command

spacecmd {SSM:0}> help snippet_create
snippet_create: Create a Kickstart snippet
usage: snippet_create [options]

options:
-n NAME
-f FILE

Then test again.

Can you create the file in a linux box then use svn to commit? Test if it has the ^M?
Where did you run dos2unix on the file, on Linux?

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.