Skip to content

Sample was failing if wsdl file location is passed as ../samples/vsph… #18

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

Merged
merged 1 commit into from
Apr 17, 2017
Merged

Conversation

pgbidkar
Copy link
Contributor

…ere/sso/wsdl/lookupservice.wsdl.

Modified Samples to convert passed wsdl file path to abspath

Signed-off-by: Pavan Bidkar [email protected]

@@ -82,7 +82,8 @@ def options(self):
self.args = self.argparser.parse_args()

def setup(self):
self.lswsdl = self.args.lswsdl
if(self.args.lswsdl):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the if check?
Can you also squash the commits to one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes..even if wsdlpath is not passed as argument, os.path.abspath gets called on None object, which is throwing error. Hence I added If for the checking argument.

Squashed commits

@@ -82,7 +82,8 @@ def options(self):
self.args = self.argparser.parse_args()

def setup(self):
self.lswsdl = self.args.lswsdl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about following?
self.lswsdl = self.args.lswsdl
if self.lswsdl:
self.lswsdl = os.path.abspath(self.lswsdl)
else:
self.lswsdl = os.path.join(
os.path.dirname(os.path.abspath(file)),

Copy link
Contributor Author

@pgbidkar pgbidkar Apr 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.. Second IF condition was to check if lswsdl is None always. I think else is more effective.
But since lswsdl is instance variable, skipping self.lswsdl = self.args.lswsdl, adding check on arg passed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pgbidkar Looks good. You can remove the () on if. Also please squash the commits.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Tianhao. Done the changes, squashed all commits and rebased.

Please let me know if more changes required

…ere/sso/wsdl/lookupservice.wsdl.

Modified Samples to convert passed wsdl file path to abspath
Added If condition to check wsdlpath is passed

Signed-off-by: PavanBidkar <[email protected]>

Modified if conition, removed optional braces

Signed-off-by: PavanBidkar <[email protected]>
@tianhao64 tianhao64 merged commit 46b7c42 into vmware:master Apr 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants