Committed by
Bob Lantz
Add check for node status to onos.py startup
Change-Id: I8e6b103ef46a5bc5877507a7adef3eb6117adf64
Showing
1 changed file
with
12 additions
and
0 deletions
... | @@ -62,6 +62,7 @@ from functools import partial | ... | @@ -62,6 +62,7 @@ from functools import partial |
62 | KarafPort = 8101 # ssh port indicating karaf is running | 62 | KarafPort = 8101 # ssh port indicating karaf is running |
63 | GUIPort = 8181 # GUI/REST port | 63 | GUIPort = 8181 # GUI/REST port |
64 | OpenFlowPort = 6653 # OpenFlow port | 64 | OpenFlowPort = 6653 # OpenFlow port |
65 | +CopycatPort = 9876 # Copycat port | ||
65 | 66 | ||
66 | def defaultUser(): | 67 | def defaultUser(): |
67 | "Return a reasonable default user" | 68 | "Return a reasonable default user" |
... | @@ -338,6 +339,17 @@ class ONOSNode( Controller ): | ... | @@ -338,6 +339,17 @@ class ONOSNode( Controller ): |
338 | info( '.' ) | 339 | info( '.' ) |
339 | self.sanityCheck() | 340 | self.sanityCheck() |
340 | time.sleep( 1 ) | 341 | time.sleep( 1 ) |
342 | + info( ' node-status' ) | ||
343 | + while True: | ||
344 | + result = quietRun( '%s -h %s "nodes"' % | ||
345 | + ( self.client, self.IP() ), shell=True ) | ||
346 | + nodeStr = 'id=%s, address=%s:%s, state=READY, updated' %\ | ||
347 | + ( self.IP(), self.IP(), CopycatPort ) | ||
348 | + if nodeStr in result: | ||
349 | + break | ||
350 | + info( '.' ) | ||
351 | + self.sanityCheck() | ||
352 | + time.sleep( 1 ) | ||
341 | info( ')\n' ) | 353 | info( ')\n' ) |
342 | 354 | ||
343 | def updateEnv( self, envDict ): | 355 | def updateEnv( self, envDict ): | ... | ... |
-
Please register or login to post a comment