eonpatapon / contrail-api-cli Goto Github PK
View Code? Open in Web Editor NEWSimple CLI program to browse Contrail API server
License: MIT License
Simple CLI program to browse Contrail API server
License: MIT License
With schema we are able to discover childs, back_refs, refs consistently
Hi,
With Python3.6, I got this error (contrail-api-cli 0.3.0):
File "/usr/lib/python3.6/ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
[Previous line repeated 308 more times]
RecursionError: maximum recursion depth exceeded while calling a Python object
After gevent update, I found this warning:
MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. It may also silently lead to incorrect behaviour on Python 3.7. Ple ase monkey-patch earlier. See https://github.com/gevent/gevent/issues/1016. Modules that had direct imports (NOT patched): ['urllib3.util (/home/vagrant/env/lib/python3.6/site-packages/urllib3/util/__init__.py)', 'urllib3.util.ssl_ (/home/vagrant/env/lib/python3.6/site-p ackages/urllib3/util/ssl_.py)'].
Once those lines removed https://github.com/eonpatapon/contrail-api-cli/blob/master/contrail_api_cli/utils.py#L25-L26, my error was gone.
Could you integrate this fix ?
Hello: I'm not sure this is the correct forum to raise an issue regarding installation errors
When following the install instructions on a CentOS machine, I get the following errors.
...
Download error on https://pypi.python.org/simple/pbr/: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:579) -- Some packages may not be found!
...
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr>=2.0.0')
...
Can anybody provide guidance?
Also, does this require a specific version of Python? My environment is defaulting to python 2.7.
This is what happens when edit command is called without args:
admin@localhost:/> edit
Traceback (most recent call last):
File "/home/kosiak/Dokumenty/capi/bin/contrail-api-cli", line 11, in <module>
load_entry_point('contrail-api-cli==0.1.1', 'console_scripts', 'contrail-api-cli')()
File "/home/kosiak/Dokumenty/capi/local/lib/python2.7/site-packages/contrail_api_cli-0.1.1-py2.7.egg/contrail_api_cli/main.py", line 91, in main
result = subcmd(**subcmd_kwargs)
File "/home/kosiak/Dokumenty/capi/local/lib/python2.7/site-packages/contrail_api_cli-0.1.1-py2.7.egg/contrail_api_cli/commands/shell.py", line 133, in __call__
result = cmd.parse_and_call(*args)
File "/home/kosiak/Dokumenty/capi/local/lib/python2.7/site-packages/contrail_api_cli-0.1.1-py2.7.egg/contrail_api_cli/command.py", line 249, in parse_and_call
return self.__call__(**vars(args))
File "/home/kosiak/Dokumenty/capi/local/lib/python2.7/site-packages/contrail_api_cli-0.1.1-py2.7.egg/contrail_api_cli/commands/edit.py", line 36, in __call__
predicate=lambda r: isinstance(r, Resource))
File "/home/kosiak/Dokumenty/capi/local/lib/python2.7/site-packages/contrail_api_cli-0.1.1-py2.7.egg/contrail_api_cli/command.py", line 158, in expand_paths
paths = [Context().shell.current_path / res for res in paths]
File "build/bdist.linux-x86_64/egg/pathlib.py", line 853, in __truediv__
File "build/bdist.linux-x86_64/egg/pathlib.py", line 643, in _make_child
File "build/bdist.linux-x86_64/egg/pathlib.py", line 605, in _parse_args
TypeError: argument should be a path or str object, not <type 'NoneType'>
after installation can't run it:
got these errors:
$ contrail-api-cli shell
Traceback (most recent call last):
File "/home/pings/contrail-api-cli-venv/bin/contrail-api-cli", line 7, in <module>
from contrail_api_cli.main import main
File "/home/pings/contrail-api-cli-venv/local/lib/python2.7/site-packages/contrail_api_cli/main.py", line 12, in <module>
from .manager import CommandManager
File "/home/pings/contrail-api-cli-venv/local/lib/python2.7/site-packages/contrail_api_cli/manager.py", line 10, in <module>
from .utils import Singleton
File "/home/pings/contrail-api-cli-venv/local/lib/python2.7/site-packages/contrail_api_cli/utils.py", line 20, in <module>
from prompt_toolkit.shortcuts import prompt, create_eventloop
ImportError: cannot import name create_eventloop
A very useful function is to have an "fsck" capability of the API:
Thx :)
Traceback (most recent call last):
File "/home/anticimex/Envs/contrail-api-cli/bin/contrail-api-cli", line 9, in <module>
load_entry_point('contrail-api-cli==0.1b1', 'console_scripts', 'contrail-api-cli')()
File "/home/anticimex/Envs/contrail-api-cli/local/lib/python2.7/site-packages/pkg_resources.py", line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/anticimex/Envs/contrail-api-cli/local/lib/python2.7/site-packages/pkg_resources.py", line 2476, in load_entry_point
return ep.load()
File "/home/anticimex/Envs/contrail-api-cli/local/lib/python2.7/site-packages/pkg_resources.py", line 2190, in load
['__name__'])
File "/home/anticimex/Envs/contrail-api-cli/local/lib/python2.7/site-packages/contrail_api_cli/main.py", line 11, in <module>
from . import commands
File "/home/anticimex/Envs/contrail-api-cli/local/lib/python2.7/site-packages/contrail_api_cli/commands.py", line 28, in <module>
from .style import PromptStyle
File "/home/anticimex/Envs/contrail-api-cli/local/lib/python2.7/site-packages/contrail_api_cli/style.py", line 3, in <module>
from prompt_toolkit.styles import DefaultStyle
ImportError: cannot import name DefaultStyle
Issue :
Given BGP AS number for the BGP Peer is not updated properly.
When i add the BGP peer using contrail CLI, the BGP Peer AS number is modified to the local AS number instead of the given one.
/usr/bin/contrail-api-cli --ns contrail_api_cli.provision add-bgp-router --router-ip 192.168.122.230 --router-asn 64510 mitaka6
Here mitaka6 AS Number is 64510.
โ119% 2d [cloud@mitak5:~/devstack] stable/mitaka* ยฑ /usr/bin/contrail-api-cli --ns contrail_api_cli.provision list-bgp-router
[
{
"router_port": 179,
"router_asn": 64513,
"router_md5": [],
"router_ip": "192.168.122.185",
"router_address_families": [
"route-target",
"inet-vpn",
"e-vpn",
"erm-vpn",
"inet6-vpn"
],
"router_type": "contrail",
"router_name": "mitak5"
},
{
"router_port": 179,
"router_asn": 64513,
"router_md5": [],
"router_ip": "192.168.122.230",
"router_address_families": [
"route-target",
"inet-vpn",
"e-vpn",
"erm-vpn",
"inet6-vpn"
],
"router_type": "contrail",
"router_name": "mitaka6"
}
]
In this, it has been modified as 64513 (local AS number)
The log show, after the CREATE bgp router,
UPDATE is called with 64513 AS number.
Attached the log for reference.
I'm facing the following error. '' TypeError: register_argparse_arguments() got an unexpected keyword argument 'default' '' when I run the following command in shell: contrail-api-cli or any argument it keeps throwing the same error.
Been stuck at this for hours now. Any help would be great.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.