aristanetworks / eoscentral Goto Github PK
View Code? Open in Web Editor NEWCode examples associated with EOS Central articles.
Code examples associated with EOS Central articles.
Hello,
First of all great repo and article network-ci-part3.
I am trying to follow up your examples git test project but having difficulties trying to pick or setup an image that can run docker-topo...
What I am trying so far if to build the image by using the docker:git
base image and using docker:dind
in services
on the job build of .gitlab-ci
.
On that image I just install python3 and pip and try to run docker-topo --create tests/docker-topo/some_topoligy.yaml
but i have the following error
$ docker-topo --create tests/data/docker/docker-topo/ceos_ring/ceos_ring.yaml
/usr/bin/docker-topo:669: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
t_yml = yaml.load(stream)
Traceback (most recent call last):
File "/usr/bin/docker-topo", line 812, in <module>
main()
File "/usr/bin/docker-topo", line 752, in main
started = [device.start() == 0 for (name, device) in devices.items()]
File "/usr/bin/docker-topo", line 752, in <listcomp>
started = [device.start() == 0 for (name, device) in devices.items()]
File "/usr/bin/docker-topo", line 331, in start
self._attach()
File "/usr/bin/docker-topo", line 348, in _attach
link.connect(self, interface)
File "/usr/bin/docker-topo", line 636, in connect
self.network.connect(device, interface)
File "/usr/bin/docker-topo", line 565, in connect
ns_fd = os.open('/proc/{}/ns/net'.format(device.pid), os.O_RDONLY)
FileNotFoundError: [Errno 2] No such file or directory: '/proc/217/ns/net'
ERROR: Job failed: exit code 1
I believe that this alpine-based image is not good to run the docker-topo....
So I was wondering you can help out with some pointers on how to build that image?
Thanks!
Looks like the API has been updated since this was published. The following diff resolves the issues. It would also probably be worth noting the user must create a config
folder in the directory the script is executed within or the script fails because the folder doesn't exist when attempting to save files into it.
diff --git a/ingest.py b/ingest.py
index 5d322d1..6d34844 100755
--- a/ingest.py
+++ b/ingest.py
@@ -78,7 +78,9 @@ class CVP(object):
response = requests.request("POST", url, data=json.dumps(data), headers=self.headers, verify=False)
if response.status_code == 200:
data = response.json()
- self.cookie = f"session_id={data.get('sessionId')}"
+ self.cookie = f"access_token={data.get('sessionId')}"
+ logging.debug(f"cookie: {self.cookie}")
logging.debug(f"Successfully authenticated on {self.ip}")
return True
else:
@@ -278,7 +280,7 @@ def main():
for k,v2 in v["value"].items():
from_intf = k
for k,v3 in v2.items():
- to_intf = v3['_key']['neighborPort']
+ to_intf = v3['key']['neighborPort']
if is_macaddress(from_intf): # Corner case for 3rd party LLDP device
from_intf = "eth0"
elif is_macaddress(to_intf):
Please check the latest commit on my repo and reflect it here too, thanks!
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.