From af05a13854097a60a5d6c7fef055895d6d517591 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Tue, 23 Aug 2016 15:33:06 -0400 Subject: [PATCH] removes invoke method from Config class this removes the invoke method which was lingering from before we separated netcfg into its own module --- lib/ansible/module_utils/netcfg.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/lib/ansible/module_utils/netcfg.py b/lib/ansible/module_utils/netcfg.py index 49de624e51c..24c905d2118 100644 --- a/lib/ansible/module_utils/netcfg.py +++ b/lib/ansible/module_utils/netcfg.py @@ -50,28 +50,19 @@ class Config(object): def __init__(self, connection): self.connection = connection - def invoke(self, method, *args, **kwargs): - try: - return method(*args, **kwargs) - except AttributeError: - exc = get_exception() - raise NetworkError('undefined method "%s"' % method.__name__, exc=str(exc)) - except NotImplementedError: - raise NetworkError('method not supported "%s"' % method.__name__) - def __call__(self, commands): lines = to_list(commands) - return self.invoke(self.connection.configure, commands) + return self.connection.configure(commands) def load_config(self, commands, **kwargs): commands = to_list(commands) - return self.invoke(self.connection.load_config, commands, **kwargs) + return self.connection.load_config(commands, **kwargs) def get_config(self, **kwargs): - return self.invoke(self.connection.get_config, **kwargs) + return self.connection.get_config(**kwargs) def save_config(self): - return self.invoke(self.connection.save_config) + return self.connection.save_config() class ConfigLine(object):