On Thu, Mar 29, 2012 at 8:00 AM, Stuart Sears <[email protected]> wrote:
> On 29/03/12 11:57, Razi Khaja wrote:
>> I am using the master branch as well from github.
>> Razi
>
> then this has been introduced since the version I'm using (admittedly
> part of RHN satellite, so not really very current at all)
>
> browsing the source on the home cobbler server (which is also upstream
> master), this is where the problem lies, as I see it:
>
> ##########################
> def find_kickstart(url):
>    """
>    Check if a kickstart url looks like an http, ftp, nfs or local path.
>    If a local path is used, cobbler will copy the kickstart and serve
>    it over http.
>
>    Return None if the url format does not look valid.
>    """
>    if url is None:
>        return None
>    x = url.lower().lstrip()
>    for y in ["http://";, "nfs://", "ftp://";, "/"]:
>       if x.startswith(y):
>           if x.startswith("/") and not os.path.isfile(x):
>               return None
>           return x
>    return None
> ###########################
>
> We are automatically lower-casing kickstart names before searching, so
> of course this doesn't work, unless we accidentally happen to have a
> non-uppercased match available in the same directory (Which would be
> odd, tbh)
>
> Anyone know why we do that? It seems curious to me.

edf29250 cobbler/utils.py (James Cammarata      2012-03-04 13:45:06
-0600  435)     x = url.lower().lstrip()

This was the commit: [BUGFIX] Fix for issue #42 - kickstart not found
error when path has leading space. But I just added the lstrip(), and
not the lower() (from commit
c09652a11eec8a14d6dded1ee743806ef4c1c2b4):

-    x = url.lower()
+    x = url.lower().lstrip()

036eb874 cobbler/util.py  (Michael DeHaan       2006-05-05 15:41:27
-0400  435)     x = url.lower()

# git log -1 036eb874
commit 036eb874ffbaf70236427ebe7c10fb883706e291
Author: Michael DeHaan <[email protected]>
Date:   Fri May 5 15:41:27 2006 -0400

    Interim commit while refactoring.  This breaks lots of stuff.

So the .lower() has been in there forever. The real issue is that I
changed it to return x, whereas before it was returning the url
variable, which did not work if the url started with whitespace. The
lower() just seems to make sure you get http instead of HtTp or
something random a user may enter, so I'll fix this to be a bit
smarter. Sorry for the breakage.
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to