andrew@onlab.us | 2bcfd8f | 2015-05-28 19:17:51 -0400 | [diff] [blame] | 1 | |
| 2 | def __init__( self ): |
| 3 | self.ip = '127.0.0.1' |
| 4 | |
| 5 | def activate( apps, nodeToActivateFrom=0 ): |
| 6 | """ |
| 7 | Activate specified applications from node specified |
| 8 | |
| 9 | Ex) apps = ['metrics', 'fwd'] |
| 10 | nodeToActivateFrom = range( 0, nodes ) |
| 11 | """ |
| 12 | if isinstance( apps, ( int, basestring ) ): |
| 13 | main.log.error( "Please pass in a list of strings for args" ) |
| 14 | return main.FALSE |
| 15 | |
| 16 | if not isinstance( nodeToActivateFrom, ( int ) ) or \ |
| 17 | nodeToActivateFrom < 0: |
| 18 | main.log.error( "Incorrect node specified" ) |
| 19 | return main.FALSE |
| 20 | |
| 21 | for app in apps: |
| 22 | # Check if app str in appList is in the main scope |
| 23 | # definition main.appList |
| 24 | if app not in main.appList: |
| 25 | main.log.error( "Invalid app name given" ) |
| 26 | return main.FALSE |
| 27 | |
| 28 | # NOTE: assumes node 1 is always activating application |
| 29 | appOutput = main.CLIs[nodeToActivateFrom].activateApp( |
| 30 | main.appList[app] ) |
| 31 | |
| 32 | return main.TRUE |
| 33 | |
| 34 | def isAppInstallSuccess(): |
| 35 | """ |
| 36 | Check the app list across clusters to determine |
| 37 | that apps have been installed successfully |
| 38 | |
| 39 | """ |
| 40 | |
| 41 | main.log.report( "isAppInstallSuccess" ) |
| 42 | |