Browse code

kamctl: require db or ctl engine made specific for dispatcher subcommands

(cherry picked from commit d2416957e4caec8a64abec82029ea18c52a7bc2d)
(cherry picked from commit d0c5a5835969660d43355fa91b39f1a8e08f6eb0)
(cherry picked from commit b316b2ac21c61b2224b721b3af61e5bb5d3f0274)

Daniel-Constantin Mierla authored on 18/11/2015 23:01:27
Showing 1 changed files
... ...
@@ -1555,15 +1555,15 @@ cr() {
1555 1555
 ### DISPATCHER management
1556 1556
 #
1557 1557
 dispatcher() {
1558
-	require_dbengine
1559
-	require_ctlengine
1560 1558
 	case $1 in
1561 1559
 		show)
1560
+			require_dbengine
1562 1561
 			mecho "dispatcher gateways"
1563 1562
 			QUERY="select * FROM $DISPATCHER_TABLE ORDER BY $DISPATCHER_SETID_COLUMN; "
1564 1563
 			$DBROCMD "$QUERY"
1565 1564
 			;;
1566 1565
 		addgw|add)
1566
+			require_dbengine
1567 1567
 			shift
1568 1568
 			if [ $# -lt 2 ] ; then
1569 1569
 				merr "too few parameters"
... ...
@@ -1610,6 +1610,7 @@ dispatcher() {
1610 1610
 
1611 1611
 			;;
1612 1612
 		rmgw|rm)
1613
+			require_dbengine
1613 1614
 			shift
1614 1615
 			if [ $# -ne 1 ] ; then
1615 1616
 				merr "missing gateway id to be removed"
... ...
@@ -1626,10 +1627,12 @@ dispatcher() {
1626 1627
 
1627 1628
 			;;
1628 1629
 		reload)
1630
+			require_ctlengine
1629 1631
 			$CTLCMD ds_reload
1630 1632
 			;;
1631 1633
 
1632 1634
 		dump)
1635
+			require_ctlengine
1633 1636
 			$CTLCMD ds_list
1634 1637
 			;;
1635 1638