Uh oh!
There was an error while loading. Please reload this page.
Abstracted the way we get absolute path - #705
Conversation
centos-ci
commented
Apr 20, 2016
Can one of the admins verify this patch? |
3 similar comments
centos-ci
commented
Apr 20, 2016
Can one of the admins verify this patch? |
centos-ci
commented
Apr 20, 2016
Can one of the admins verify this patch? |
centos-ci
commented
Apr 20, 2016
Can one of the admins verify this patch? |
| @staticmethod | ||
| def get_abspath(path): | ||
| return os.path.join(Utils.getRoot(), path) |
There was a problem hiding this comment.
I think that we should add .lstrip('/') to path here, as it should be always called with lstrip('/')
getRoot returns '/host' or '/'
with leading '/' in second argument os.path.join cuts first part in path
>>> os.path.join("/host","/foo/bar")
'/foo/bar'
>>> os.path.join("/host","foo/bar")
'/host/foo/bar'
bd81b13 to
df2885dComparesurajssd
commented
Apr 20, 2016
@kadel done! |
kadel
commented
Apr 20, 2016
#dotests |
| @staticmethod | ||
| def get_abspath(path): | ||
| return os.path.join(Utils.getRoot(), path.lstrip('/')) |
There was a problem hiding this comment.
Add a comment about what this function is doing if you don't mind.
dustymabe
commented
Apr 20, 2016
kube test failed due to yum error reaching repos. Trying again. |
dustymabe
commented
Apr 20, 2016
#dotestkubernetes |
Added a staticmethod in utils.Utils named get_real_abspath which abstracts the use of os.path.join(Utils.getRoot, path)
df2885d to
001b3e4Compare@dustymabe done as you said also rebased! |
dustymabe
commented
Apr 20, 2016
#dotests |
dustymabe
commented
Apr 20, 2016
LGTM - @cdrage.. do you mind spot checking this before merge? |
| args.cli_answers[item] = getattr(args, item) | ||
| lock = LockFile(os.path.join(Utils.getRoot(), LOCK_FILE)) | ||
| lock = LockFile(Utils.get_real_abspath(LOCK_FILE)) |
There was a problem hiding this comment.
I'll have to rebase this on my PR on removing the lockfile, but that's fine :)
cdrage
commented
Apr 20, 2016
Tests pass locally, code looks a-okay! LGTM 👍 Merge when ready |
dustymabe
commented
Apr 20, 2016
#dotestopenshift |
Added a
staticmethodinutils.Utilsnamedget_abspathwhich abstracts the use ofos.path.join(Utils.getRoot, path)