all the python scripts are for python2, and fedora31 requires to be specific
[vsys-scripts.git] / root-context / exec / makeswitch
1 #!/usr/bin/python2
2
3 import sys
4 import pwd
5 import re
6 import socket
7 import struct
8 import os
9 import string
10
11 vsys_config_dir = "/etc/planetlab/vsys-attributes"
12
13 if len(sys.argv) != 2: sys.exit(1)
14
15 slicename=sys.argv[1]
16 sliceid = pwd.getpwnam(slicename).pw_uid
17
18 dpname = "dp-%d"%sliceid
19
20 print "Requesting creation of data path %s."%dpname
21 os.system("ovs-dpctl add-dp %s"%dpname)