-
Notifications
You must be signed in to change notification settings - Fork 17
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
Docker-machine addred suport to Vsphere for extra arument #11
Conversation
Docker-machine create() added one more list parameter, it will suport vmwarevsphere create.
machine/machine.py
Outdated
@@ -86,7 +86,7 @@ def version(self): | |||
match = self._match(cmd, regexp) | |||
return match.group(1) | |||
|
|||
def create(self, name, driver='virtualbox', blocking=True): | |||
def create(self, name, driver='virtualbox', blocking=True, xarg=[]): |
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.
Thanks for your PR!
This is not a good idea:
http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments
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.
yes, you are right. Done the changes as you suggested.
machine/machine.py
Outdated
@@ -99,7 +99,10 @@ def create(self, name, driver='virtualbox', blocking=True): | |||
Returns: | |||
int: error code from the run | |||
""" | |||
cmd = ['create', '--driver', driver, name] | |||
cmd = ['create', '--driver', driver] |
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.
This can be written as `cmd = ['create', '--driver', driver] + xarg + [name]
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.
Done the changes as you suggested.
1) Removed Mutable Default Arguments 2) cmd argument list merge modified.
perfect thanks! |
While Creating Vsphere Vcenter machine , it need extra argument, so added list for xarg.
this list will contain create parameter.