-
Notifications
You must be signed in to change notification settings - Fork 70
Abstracted the way we get absolute path #705
Conversation
|
Can one of the admins verify this patch? |
3 similar comments
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
atomicapp/utils.py
Outdated
|
|
||
| @staticmethod | ||
| def get_abspath(path): | ||
| return os.path.join(Utils.getRoot(), path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
df2885d
Compare
|
@kadel done! |
|
#dotests |
|
|
||
| @staticmethod | ||
| def get_abspath(path): | ||
| return os.path.join(Utils.getRoot(), path.lstrip('/')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment about what this function is doing if you don't mind.
|
kube test failed due to yum error reaching repos. Trying again. |
|
#dotestkubernetes |
Added a staticmethod in utils.Utils named get_real_abspath which abstracts the use of os.path.join(Utils.getRoot, path)
df2885d to
001b3e4
Compare
|
@dustymabe done as you said also rebased! |
|
#dotests |
|
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have to rebase this on my PR on removing the lockfile, but that's fine :)
|
Tests pass locally, code looks a-okay! LGTM 👍 Merge when ready |
|
#dotestopenshift |
Added a
staticmethodinutils.Utilsnamedget_abspathwhich abstracts the use ofos.path.join(Utils.getRoot, path)