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

fixing missing parameter exception for ex_add_access_config function #435

wants to merge 1 commit into from


Copy link

@pmoosh pmoosh commented Jan 18, 2015

Missing nic parameter throws exception in gce.ex_add_access_config

stderr: Traceback (most recent call last):
  File "/Users/pmoosh/.ansible/tmp/ansible-tmp-1421538564.46-10999847043196/", line 139, in <module>
  File "/Users/pmoosh/.ansible/tmp/ansible-tmp-1421538564.46-10999847043196/", line 128, in main
    gce.ex_add_access_config(node = my_instance, name = ACC_CNF_NM, nat_ip = item.address)
  File "/Users/pmoosh/src/apache-libcloud/libcloud/compute/drivers/", line 941, in ex_add_access_config
    self.connection.async_request(request, method='POST', data=config)
  File "/Users/pmoosh/src/apache-libcloud/libcloud/common/", line 866, in async_request
    response = request(**kwargs)
  File "/Users/pmoosh/src/apache-libcloud/libcloud/common/", line 669, in request
    *args, **kwargs)
  File "/Users/pmoosh/src/apache-libcloud/libcloud/common/", line 736, in request
    response = responseCls(**kwargs)
  File "/Users/pmoosh/src/apache-libcloud/libcloud/common/", line 119, in __init__
    self.object = self.parse_body()
  File "/Users/pmoosh/src/apache-libcloud/libcloud/common/", line 267, in parse_body
    raise InvalidRequestError(message, self.status, code) {'locationType': 'parameter', 'domain': 'global', 'message': 'Required parameter: networkInterface', 'reason': 'required', 'location': 'networkInterface'}

Copy link

Kami commented Jan 18, 2015

/cc @erjohnso

@@ -934,10 +935,11 @@ def ex_add_access_config(self, node, name, nat_ip=None, config_type=None):

if nat_ip is not None:
config['natIP'] = nat_ip

params = {'accessConfig': name, 'networkInterface': nic}
Copy link

@erjohnso erjohnso Jan 19, 2015

Choose a reason for hiding this comment

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

@pmoosh - Looks like params should only contain 'networkInterface' []. The rest of the data goes into the body of the request (the config dict). I also don't see an explicit reference to attribute/param called accessConfig. Looks like the body should be,

  "kind": "compute#accessConfig",
  "type": string,
  "name": string,
  "natIP": string

And we don't need to set kind.

Copy link

erjohnso commented Jan 19, 2015

Thanks for this @pmoosh! After you remove the accessConfig, can you also squash your commits and then I'll go ahead and merge it in.

@asfgit asfgit closed this in b2caf0f Jan 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants