Skip to content
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

knife[:vra_base_url] causes an error if URL has a trailing slash #24

Closed
vinyar opened this issue May 10, 2017 · 2 comments
Closed

knife[:vra_base_url] causes an error if URL has a trailing slash #24

vinyar opened this issue May 10, 2017 · 2 comments

Comments

@vinyar
Copy link

vinyar commented May 10, 2017

The resulting error is 'HTTPNotFound'
Removing trailing slash fixes the issue.

Expectation:
Presence of trailing slash makes no difference.

bad:
knife[:vra_base_url] = 'https://vra.corp.local/'

good:
knife[:vra_base_url] = 'https://vra.corp.local'

@vinyar
Copy link
Author

vinyar commented May 10, 2017

Would this work:

         includer.class_eval do
            option :vra_base_url,
              long:        '--vra-base-url API_URL',
              description: 'URL for the vRA server',
              proc:        proc { |url| url.sub(/(\/)+$/,'') }

https://github.com/chef-partners/knife-vrealize/blob/0c793ca5aad23282611093cc98a08a130ca2c717/lib/chef/knife/cloud/vra_service_options.rb#L30

@jjasghar
Copy link

This seems pretty reasonable. I'd have to verify it on a vRA instance though. Can you put a PR in for the change?

@jjasghar jjasghar mentioned this issue Jun 20, 2017
jjasghar pushed a commit that referenced this issue Aug 21, 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

No branches or pull requests

2 participants