openbaton/NFVO

OpenBaton CLI : error using openbaton CLI

Closed this issue · 2 comments

when searching for my error for openbaton in #294, i found this mailing list https://listen.openbaton.org/sympa/arc/users/2018-03/msg00006.html. that suggest to use CLI. when im trying to use CLI. there have error in python code.

Insert Open Baton Password:root@ubuntu:/home/ubuntu# 
root@ubuntu:/home/ubuntu# openbaton project list
Traceback (most recent call last):
  File "/usr/local/bin/openbaton", line 11, in <module>
    sys.exit(start())
  File "/usr/local/lib/python2.7/dist-packages/org/openbaton/cli/openbaton.py", line 323, in start
    nfvo_ip=nfvo_ip, nfvo_port=nfvo_port, https=ssl_enabled, format=format)
  File "/usr/local/lib/python2.7/dist-packages/org/openbaton/cli/openbaton.py", line 221, in openbaton
    _exec_action(factory, agent_choice, action, project_id, params, format)
  File "/usr/local/lib/python2.7/dist-packages/org/openbaton/cli/openbaton.py", line 65, in _exec_action
    result = get_result_as_list_find_all(ag.find(), agent_choice, format)
  File "/usr/local/lib/python2.7/dist-packages/org/openbaton/cli/agents/agents.py", line 93, in find
    return self._client.get(self.url + "/%s" % _id)
  File "/usr/local/lib/python2.7/dist-packages/org/openbaton/cli/utils/RestClient.py", line 44, in get
    self.token = self._get_token()
  File "/usr/local/lib/python2.7/dist-packages/org/openbaton/cli/utils/RestClient.py", line 168, in _get_token
    res_dict = json.loads(response.text)
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
root@ubuntu:/home/ubuntu# openbaton NetworkServiceDescriptor-create iperf.json 
Traceback (most recent call last):
  File "/usr/local/bin/openbaton", line 11, in <module>
    sys.exit(start())
  File "/usr/local/lib/python2.7/dist-packages/org/openbaton/cli/openbaton.py", line 323, in start
    nfvo_ip=nfvo_ip, nfvo_port=nfvo_port, https=ssl_enabled, format=format)
  File "/usr/local/lib/python2.7/dist-packages/org/openbaton/cli/openbaton.py", line 221, in openbaton
    _exec_action(factory, agent_choice, action, project_id, params, format)
  File "/usr/local/lib/python2.7/dist-packages/org/openbaton/cli/openbaton.py", line 53, in _exec_action
    if action not in ACTIONS and action not in get_additional_action(agent_choice):
  File "/usr/local/lib/python2.7/dist-packages/org/openbaton/cli/config.py", line 135, in get_additional_action
    return AGENTS_ACTIONS.get(agent_choice).get("ADDITIONAL_ACTIONS")
AttributeError: 'NoneType' object has no attribute 'get'
root@ubuntu:/home/ubuntu#

Hello.

I'm facing the same problem. Did you find a workaroud?

It may be related to "The request was rejected because the URL was not normalized." error, if OpenBaton CLI is using the REST API. It's just a guess, though...

Maybe someone from Fraunhofer could provide feedback?

Regards,
Daniel

Regarding the command openbaton project list in my case works properly; openbaton-nfvo 5.2.1, openbaton-cli 5.1.1, python3. I think is a version mismatch.

The command openbaton NetworkServiceDescriptor-create iperf.json is wrong. You should use openbaton nsd create iperf.json
However the error you got comes from the openbaton-cli (https://github.com/openbaton/openbaton-cli), if you have futher problems please open an issue there.