From: Giuseppe Lettieri Date: Thu, 27 Sep 2012 14:46:14 +0000 (+0200) Subject: accept a default vale for CONTROLLER_x X-Git-Tag: sliver-openvswitch-1.8.90-3~3 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=38524ebce2d22b0bdd2ca368a4270b9bdca49650 accept a default vale for CONTROLLER_x If $(CONTROLLER_x) is empty the Makefile will default to $(CONTROLLER). --- diff --git a/planetlab/exp-tool/Makefile b/planetlab/exp-tool/Makefile index 0e523721c..d151a6648 100644 --- a/planetlab/exp-tool/Makefile +++ b/planetlab/exp-tool/Makefile @@ -38,6 +38,7 @@ opp=$(call linkpart,$(1))@$(call flip,$(call endpart,$(1))) # rget(x-y@2) = x rget=$(call get,$(call opp,$(1))) ### +default=$(if $($(1)_$(2)),$($(1)_$(2)),$($(1))) solve=$(HOST_$(1)) solve_ip=$(IP_$(1)) # can be redefined in conf.mk if that's not the expected behaviour @@ -146,8 +147,8 @@ cache/bridge.%: cache/switch.% @echo Created bridge with tap $$(cat $@) on $(call display,$*) cache/controller.%: cache/bridge.% - @echo "Setting controller on $(call display,$*) - logs in $(call log,$@)" - @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs set-controller $(BRIDGE) $(CONTROLLER_$*) &> $(call log,$@) || { rm $@; exit 1; } + @echo "Setting controller $(call default,CONTROLLER,$*) on $(call display,$*) - logs in $(call log,$@)" + @$(SSH) $(HOST_$*) $(SUDO) ovs-vsctl set-controller $(BRIDGE) $(call default,CONTROLLER,$*) &> $(call log,$@) || { rm $@; exit 1; } # xxx this probably needs a more thorough cleanup in cache/ cache/stop.%: del-bridge.%