-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First lag on the way of eliminating os.system from dazel's code #8
base: master
Are you sure you want to change the base?
Conversation
dazel.py
Outdated
rc = 0 | ||
if rc: | ||
return rc | ||
if not self._pull and not self._image_exists(): |
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 you meant "self._pull()" right?
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.
Fixed.
decode=True): | ||
if "error" in line: | ||
print("ERROR:", line["error"]) | ||
return False |
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.
There can only be one line of error?
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.
As far as I know, yes.
Docs are not clear about it though :(
|
||
return rc | ||
return 0 |
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.
Why not return True here to be consistent?
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.
Cause it's going to be returned from many other places, and I didn't want to refactor the whole code with that in mind. Its something we should do later on.
I've introduced docker-py into the code, and moved most of os.system(docker) calls to use that docker python api instead.
Next steps: Using docker-compose python api for the compose calls.