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

remove_ip broken #59

Open
richyjay opened this issue May 23, 2019 · 0 comments
Open

remove_ip broken #59

richyjay opened this issue May 23, 2019 · 0 comments

Comments

@richyjay
Copy link

Error when calling CloudInterface.remove_ip(ip_id=resourceid)

Traceback (most recent call last):
  File "./getIps.py", line 45, in <module>
    ci.remove_ip(ip_id=467227)
  File "build/bdist.linux-x86_64/egg/ArubaCloud/PyArubaAPI.py", line 304, in remove_ip
  File "build/bdist.linux-x86_64/egg/ArubaCloud/base/__init__.py", line 29, in gen_def_json_scheme
ValueError: dictionary update sequence element #0 has length 1; 2 is required

Fix: Change line 303 of ArubaCloud/PyArubaAPI.py from:
ip_id = ' "IpAddressResourceId": %s' % ip_id
To:
ip_id = {'IpAddressResourceId': ip_id}

Full method:

def remove_ip(self, ip_id):
        """
        Delete an Ip from the boughs ip list
        @param (str) ip_id: a string representing the resource id of the IP
        @return: True if json method had success else False
        """
        #ip_id = '    "IpAddressResourceId": %s' % ip_id
        ip_id = {'IpAddressResourceId': ip_id}
        json_scheme = self.gen_def_json_scheme('SetRemoveIpAddress', ip_id)
        json_obj = self.call_method_post(method='SetRemoveIpAddress', json_scheme=json_scheme)
        pprint(json_obj)

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

1 participant