src/nepi/execution/resource.py
[nepi.git] / examples / omf / nitos_testbed_bootstrap.py
index 452114f..771e188 100644 (file)
@@ -82,7 +82,7 @@ ec.set(reboot_app, "command", reboot_cmd)
 ec.register_connection(reboot_app, gw_node)\r
 \r
 ec.register_condition(reboot_app, ResourceAction.START, load_app, \r
-            ResourceState.STOPPED, time="300s") \r
+            ResourceState.STOPPED, time="60s") \r
 \r
 hosts = hosts.split(",")\r
 \r
@@ -98,11 +98,15 @@ for hostname in hosts:
     ec.register_condition(node, ResourceAction.DEPLOY, reboot_app, \r
             ResourceState.STOPPED, time="300s") \r
  \r
-    app = ec.register_resource("linux::Application")\r
-    ec.set(app, "command", "modprobe ath5k && ip a | grep wlan0 && service omf_rc restart")\r
-    ec.register_connection(app, node)\r
-   \r
-    apps.append(app)\r
+    modprobe_app = ec.register_resource("linux::Application")\r
+    ec.set(modprobe_app, "command", "modprobe ath5k && ip a | grep wlan0")\r
+    ec.register_connection(modprobe_app, node)\r
+    apps.append(modprobe_app)\r
+\r
+    rc_app = ec.register_resource("linux::Application")\r
+    ec.set(rc_app, "command", "service omf_rc stop; service omf_rc start")\r
+    ec.register_connection(rc_app, node)\r
+    apps.append(rc_app)\r
 \r
 print "This might take time..."\r
 \r