Skip to content

Instantly share code, notes, and snippets.

@almusil
Created June 11, 2021 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almusil/696ae7f51624bcf9e5e00c4de8323c32 to your computer and use it in GitHub Desktop.
Save almusil/696ae7f51624bcf9e5e00c4de8323c32 to your computer and use it in GitHub Desktop.
from neutronclient.v2_0 import client
URL = 'ovn-engine'
credentials = {
'username': 'admin@internal',
'password': '123456',
'auth_url': f'https://{URL}:35357/v2.0',
'endpoint_url': f'https://{URL}:9696',
'insecure': True,
}
net_body = {'network': {'name': 'ovn_net'}}
def clear(neutron):
for net in neutron.list_networks()['networks']:
neutron.delete_network(net['id'])
def reproduce(neutron):
neutron.list_networks()
neutron.create_network(net_body)
if __name__ == '__main__':
neutron = client.Client(**credentials)
# clear(neutron)
reproduce(neutron)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment