Merge pull request #3 from dwallacelf/fix-vpp-args
Fix optional vpp args handling
This commit is contained in:
		| @@ -27,8 +27,13 @@ class Applier(VPPApi): | |||||||
|  |  | ||||||
|     # pylint: disable=unnecessary-pass |     # pylint: disable=unnecessary-pass | ||||||
|  |  | ||||||
|     def __init__(self, address="/run/vpp/api.sock", clientname="vppcfg"): |     def __init__( | ||||||
|         VPPApi.__init__(self, address, clientname) |         self, | ||||||
|  |         vpp_api_socket="/run/vpp/api.sock", | ||||||
|  |         vpp_json_dir="/usr/share/vpp/api/", | ||||||
|  |         clientname="vppcfg", | ||||||
|  |     ): | ||||||
|  |         VPPApi.__init__(self, vpp_api_socket, vpp_json_dir, clientname) | ||||||
|         self.logger.info("VPP Applier: changing the dataplane is enabled") |         self.logger.info("VPP Applier: changing the dataplane is enabled") | ||||||
|  |  | ||||||
|     def set_interface_ip_address(self, ifname, address, is_set=True): |     def set_interface_ip_address(self, ifname, address, is_set=True): | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								vppcfg
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								vppcfg
									
									
									
									
									
								
							| @@ -199,9 +199,9 @@ def main(): | |||||||
|     ) |     ) | ||||||
|  |  | ||||||
|     opt_kwargs = {} |     opt_kwargs = {} | ||||||
|     if "vpp_json_dir" in args: |     if "vpp_json_dir" in args and args.vpp_json_dir is not None: | ||||||
|         opt_kwargs["vpp_json_dir"] = args.vpp_json_dir |         opt_kwargs["vpp_json_dir"] = args.vpp_json_dir | ||||||
|     if "vpp_api_socket" in args: |     if "vpp_api_socket" in args and args.vpp_api_socket is not None: | ||||||
|         opt_kwargs["vpp_api_socket"] = args.vpp_api_socket |         opt_kwargs["vpp_api_socket"] = args.vpp_api_socket | ||||||
|  |  | ||||||
|     if args.command == "dump": |     if args.command == "dump": | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user