Skip to content
Snippets Groups Projects
Commit b7898bef authored by backb1's avatar backb1 Committed by Bob Lantz
Browse files

raise exception when no prefixLen is set

parent 6721f065
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,8 @@ def setIP( self, ipstr, prefixLen=None ):
self.ip, self.prefixLen = ipstr.split( '/' )
return self.ifconfig( ipstr, 'up' )
else:
if prefixLen is None:
raise Exception( 'No prefix length set for IP address %s' % ( ipstr, ) )
self.ip, self.prefixLen = ipstr, prefixLen
return self.ifconfig( '%s/%s' % ( ipstr, prefixLen ) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment