mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 19:32:31 +00:00 
			
		
		
		
	enhance setroute doc and routeop return code (#4798)
* enhance return code when error happen * specify removing gateway from networks when configure static route
This commit is contained in:
		| @@ -10,6 +10,8 @@ There are 2 ways to configure OS route in xCAT: | ||||
|  | ||||
| Before using ``makeroutes`` or ``setroute`` to configure OS route, details of the routes data such as routename, subnet, net mask and gateway should be stored in ``routes`` table. | ||||
|  | ||||
| **Notes**: the ``gateway`` in the ``networks`` table assigns ``gateway`` from DHCP to compute node, so if use ``makeroutes`` or ``setroute`` to configure OS static route for compute node, make sure there is no ``gateway`` for the specific network in ``networks`` table. | ||||
|  | ||||
| Configure ``routes`` table | ||||
| `````````````````````````` | ||||
|  | ||||
|   | ||||
| @@ -271,7 +271,7 @@ replace_persistent_route() | ||||
|             #echo "rh/fedora/centos" | ||||
|             if [ -z "$ifname" ]; then | ||||
|                 echo "Error: the device name is necessary to configure static route." | ||||
|                 return | ||||
|                 return 1 | ||||
|             fi | ||||
|              | ||||
|             if echo $net | grep : 2>&1 1>/dev/null | ||||
| @@ -319,7 +319,7 @@ replace_persistent_route() | ||||
|             # on debian/ubuntu need the network device name | ||||
|             if [ -z "$ifname" ]; then | ||||
|                 echo "Error: the device name is necessary to configure static route." | ||||
|                 return | ||||
|                 return 1 | ||||
|             fi | ||||
|             filename="/etc/network/interfaces.d/$ifname" | ||||
|  | ||||
| @@ -901,7 +901,10 @@ elif [ "$op" = "replace" ]; then | ||||
|     #replace the persistent route | ||||
|     # the $cmd param is used for Ubuntu since it needs to run the specific cmd to enable  | ||||
|     # the route during the up of the device | ||||
|     replace_persistent_route $net $mask $gw $ifname  | ||||
|     replace_persistent_route $net $mask $gw $ifname | ||||
|     if [ $? -ne 0 ]; then | ||||
|         exit 1 | ||||
|     fi  | ||||
| fi | ||||
|  | ||||
| exit 0 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user