tom

Fixed onos-push-update-bundle tool.

Fixed wipe-out command confirmation.
...@@ -13,40 +13,41 @@ import org.onlab.onos.net.intent.IntentService; ...@@ -13,40 +13,41 @@ import org.onlab.onos.net.intent.IntentService;
13 import org.onlab.onos.net.intent.IntentState; 13 import org.onlab.onos.net.intent.IntentState;
14 14
15 /** 15 /**
16 - * Wipes-out the entire network information base, i.e. devices, links, hosts. 16 + * Wipes-out the entire network information base, i.e. devices, links, hosts, intents.
17 */ 17 */
18 @Command(scope = "onos", name = "wipe-out", 18 @Command(scope = "onos", name = "wipe-out",
19 description = "Wipes-out the entire network information base, i.e. devices, links, hosts") 19 description = "Wipes-out the entire network information base, i.e. devices, links, hosts")
20 public class WipeOutCommand extends ClustersListCommand { 20 public class WipeOutCommand extends ClustersListCommand {
21 21
22 - 22 + private static final String DISCLAIMER = "Delete everything please.";
23 - private static final String DISCLAIMER = "Yes, I know it will delete everything!";
24 23
25 @Argument(index = 0, name = "disclaimer", description = "Device ID", 24 @Argument(index = 0, name = "disclaimer", description = "Device ID",
26 - required = true, multiValued = false) 25 + required = false, multiValued = false)
27 String disclaimer = null; 26 String disclaimer = null;
28 27
29 @Override 28 @Override
30 protected void execute() { 29 protected void execute() {
31 - if (!disclaimer.equals(DISCLAIMER)) { 30 + if (disclaimer == null || !disclaimer.equals(DISCLAIMER)) {
32 - print("I'm afraid I can't do that..."); 31 + print("I'm afraid I can't do that!\nPlease acknowledge with phrase: '%s'",
33 - print("You have to acknowledge by: " + DISCLAIMER); 32 + DISCLAIMER);
34 return; 33 return;
35 } 34 }
36 35
37 - print("Good bye..."); 36 + print("Wiping devices");
38 DeviceAdminService deviceAdminService = get(DeviceAdminService.class); 37 DeviceAdminService deviceAdminService = get(DeviceAdminService.class);
39 DeviceService deviceService = get(DeviceService.class); 38 DeviceService deviceService = get(DeviceService.class);
40 for (Device device : deviceService.getDevices()) { 39 for (Device device : deviceService.getDevices()) {
41 deviceAdminService.removeDevice(device.id()); 40 deviceAdminService.removeDevice(device.id());
42 } 41 }
43 42
43 + print("Wiping hosts");
44 HostAdminService hostAdminService = get(HostAdminService.class); 44 HostAdminService hostAdminService = get(HostAdminService.class);
45 HostService hostService = get(HostService.class); 45 HostService hostService = get(HostService.class);
46 for (Host host : hostService.getHosts()) { 46 for (Host host : hostService.getHosts()) {
47 hostAdminService.removeHost(host.id()); 47 hostAdminService.removeHost(host.id());
48 } 48 }
49 49
50 + print("Wiping intents");
50 IntentService intentService = get(IntentService.class); 51 IntentService intentService = get(IntentService.class);
51 for (Intent intent : intentService.getIntents()) { 52 for (Intent intent : intentService.getIntents()) {
52 if (intentService.getIntentState(intent.id()) == IntentState.INSTALLED) { 53 if (intentService.getIntentState(intent.id()) == IntentState.INSTALLED) {
......
1 -<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 -<!--
3 - ~ Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
4 - ~
5 - ~ This program and the accompanying materials are made available under the
6 - ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 - ~ and is available at http://www.eclipse.org/legal/epl-v10.html
8 - -->
9 -
10 -<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
11 - name="net.onrc.onos-1.0.0">
12 - <repository>mvn:net.onrc.onos/onos-features/1.0.0-SNAPSHOT/xml/features</repository>
13 -
14 - <feature name="thirdparty" version="1.0.0"
15 - description="ONOS 3rd party dependencies">
16 - <bundle>mvn:com.google.code.findbugs/annotations/2.0.2</bundle>
17 - <bundle>mvn:io.netty/netty/3.9.2.Final</bundle>
18 - <bundle>mvn:com.google.guava/guava/17.0</bundle>
19 - <bundle>mvn:com.google.guava/guava/15.0</bundle>
20 -
21 - </feature>
22 -
23 - <feature name="base" version="1.0.0"
24 - description="ONOS Base">
25 - <feature>scr</feature>
26 - <feature>thirdparty</feature>
27 - <bundle>mvn:net.onrc.onos.sb/onos-sb/0.0.1</bundle>
28 - <bundle>mvn:org.projectfloodlight/openflowj/0.3.6-SNAPSHOT</bundle>
29 - </feature>
30 -
31 -</features>
...@@ -33,6 +33,7 @@ alias obs='onos-build-selective' ...@@ -33,6 +33,7 @@ alias obs='onos-build-selective'
33 alias op='onos-package' 33 alias op='onos-package'
34 alias ot='onos-test' 34 alias ot='onos-test'
35 alias ol='onos-log' 35 alias ol='onos-log'
36 +alias go='ob && ot && onos -w'
36 alias pub='onos-push-update-bundle' 37 alias pub='onos-push-update-bundle'
37 38
38 # Short-hand for tailing the ONOS (karaf) log 39 # Short-hand for tailing the ONOS (karaf) log
......
...@@ -15,7 +15,7 @@ bundle=$(echo $(basename $jar .jar) | sed 's/-[0-9].*//g') ...@@ -15,7 +15,7 @@ bundle=$(echo $(basename $jar .jar) | sed 's/-[0-9].*//g')
15 15
16 nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2) 16 nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
17 for node in $nodes; do 17 for node in $nodes; do
18 + scp -q $jar $ONOS_USER@$node:.m2/repository/$jar
18 scp -q $jar $ONOS_USER@$node:$ONOS_INSTALL_DIR/$KARAF_DIST/system/$jar 19 scp -q $jar $ONOS_USER@$node:$ONOS_INSTALL_DIR/$KARAF_DIST/system/$jar
19 - ssh $ONOS_USER@$node "ls -l $ONOS_INSTALL_DIR/$KARAF_DIST/system/$jar"
20 ssh $ONOS_USER@$node "$ONOS_INSTALL_DIR/bin/onos \"bundle:update -f $bundle\"" 2>/dev/null 20 ssh $ONOS_USER@$node "$ONOS_INSTALL_DIR/bin/onos \"bundle:update -f $bundle\"" 2>/dev/null
21 done 21 done
......