# If a socket name is sent, send the STOP message and wait for a reply
if socket_name:
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- sock.connect(socket_name)
- encoded = base64.b64encode(STOP_MSG)
- sock.send("%s\n" % encoded)
- reply = sock.recv(1024)
- reply = base64.b64decode(reply)
- print reply
-
+ try:
+ sock.connect(socket_name)
+ encoded = base64.b64encode(STOP_MSG)
+ sock.send("%s\n" % encoded)
+ reply = sock.recv(1024)
+ reply = base64.b64decode(reply)
+ print reply
+ except:
+ print "Did not properly shutdown device"
# If a slicename is provided, use it to remove a GRE device
elif slicename:
import pwd