Forum Replies Created
-
AuthorPosts
-
I just pushed an update to the PR
Thanks for the comments. I think I address most of the issues (I did not get mypy to work in the time I had allocated for this) but I added some conditions that should make a static checker happy and some other fixes.
I also just fixed
fabric-cli slices delete
– I did not test yesterday due to the workshop 😀Fixed in PR 45: https://github.com/fabric-testbed/fabric-cli/pull/45
I use Python directly most of the time but sometimes it’s nice to have a simple script to grab the IP of a slice/node from the command line. This is what I would do in the past to grab the management IP to then kick off some ssh based tools as follows (yes, I could write this in python but bash/jq is my hammer of choice):
SLICEID=$(fabric-cli slices query --state=StableOK | jq -r '.[0].slice_id') ; echo $SLICEID IP=$(fabric-cli slivers query --sliceid=$SLICEID | jq -r '.[0].sliver' | jq -r '.MgmtIp') ; echo $IP
Would you consider a pull request that did a json.dumps() to format the output?
Thanks.
I am still able to replicate it. Here is the code.
## Dump Config for i in ['FABRIC_PROJECT_ID']: print(f'{i}={os.environ}') ## Ping auth test print(fablib.get_site_names()) ## Create slice slice = fablib.new_slice(name="oneslice") node = slice.add_node(name="node1", image="default_ubuntu_22") slice.submit(wait=True) # Change to False to run correctly. print(slice) slice.wait_ssh() slice.test_ssh() print(node)
The environment is built via the following:
python3 -m venv .venv . .venv/bin/activate python3 -m pip install --upgrade pip python3 -m pip install git+https://github.com/fabric-testbed/fabric-cli.git python3 -m pip install git+https://github.com/fabric-testbed/fabrictestbed-extensions.git
All config-values are set via env. I have a complete example w/ docs if you want.
It’s run on MACOS, tools installed via brew.
(.venv) tmiddelkoop@tmiddelkoopsMBP fabric % python3 --version Python 3.9.13
Great – I’ll port my change back to that when it’s released (it ended up being not so hard to do it on the node). (I did and do not expect a fully thread-safe version of the library – I know how hard that can be).
I would also be interested in adding curl and jq
-
AuthorPosts