diff options
| author | Sebastian Ramacher <[email protected]> | 2023-01-21 21:29:09 +0100 |
|---|---|---|
| committer | git-ubuntu importer <[email protected]> | 2023-01-24 23:25:43 +0000 |
| commit | 4952aa06eee0dbc354d90681d96a39b405c6465d (patch) | |
| tree | 42b75d3a07ea58d4823b9c18870d1095e1550cb1 | |
| parent | 5e2bda40fa701c641d7b26f531b9618f7a8330a5 (diff) | |
| parent | de53f05312aedcae2391b0b291d475e2b5b43bf2 (diff) | |
1:1.1.28-2.1 (patches applied)applied/1%1.1.28-2.1applied/ubuntu/oracular-develapplied/ubuntu/oracularapplied/ubuntu/noble-develapplied/ubuntu/nobleapplied/ubuntu/mantic-develapplied/ubuntu/manticapplied/ubuntu/lunar-proposedapplied/ubuntu/lunar-develapplied/ubuntu/lunarapplied/debian/bookworm
Imported using git-ubuntu import.
| -rw-r--r-- | configshell/node.py | 38 | ||||
| -rw-r--r-- | debian/changelog | 9 | ||||
| -rw-r--r-- | debian/patches/replace-getargspec-with-getfullargspec.patch | 31 | ||||
| -rw-r--r-- | debian/patches/replace-more-occurrences-of-getargspec-with-getfullargspec.patch | 70 | ||||
| -rw-r--r-- | debian/patches/series | 2 |
5 files changed, 131 insertions, 19 deletions
diff --git a/configshell/node.py b/configshell/node.py index 6af8642..4f0ec9e 100644 --- a/configshell/node.py +++ b/configshell/node.py @@ -1417,10 +1417,10 @@ class ConfigNode(object): @type kparams: dict @raise ExecutionError: When the check fails. ''' - spec = inspect.getargspec(method) + spec = inspect.getfullargspec(method) args = spec.args[1:] pp = spec.varargs - kw = spec.keywords + kw = spec.varkw if spec.defaults is None: nb_opt_params = 0 @@ -1460,7 +1460,7 @@ class ConfigNode(object): "Missing required parameters %s" % ", ".join("'%s'" % missing for missing in missing_params)) - if spec.keywords is None: + if kw is None: if len(unexpected_keywords) == 1: raise ExecutionError( "Unexpected keyword parameter '%s'." @@ -1575,12 +1575,12 @@ class ConfigNode(object): @type command: str ''' method = self.get_command_method(command) - parameters, args, kwargs, default = inspect.getargspec(method) - parameters = parameters[1:] - if default is None: + spec = inspect.getfullargspec(method) + parameters = spec.args[1:] + if spec.defaults is None: num_defaults = 0 else: - num_defaults = len(default) + num_defaults = len(spec.defaults) if num_defaults != 0: required_parameters = parameters[:-num_defaults] @@ -1605,16 +1605,16 @@ class ConfigNode(object): syntax += optional_parameters_str comments = [] - if args is not None: - syntax += "[%s...] " % args - if kwargs is not None: - syntax += "[%s=value...] " % (kwargs) + if spec.varargs is not None: + syntax += "[%s...] " % spec.varargs + if spec.varkw is not None: + syntax += "[%s=value...] " % (spec.varkw) default_values = '' if num_defaults > 0: for index, param in enumerate(optional_parameters): - if default[index] is not None: - default_values += "%s=%s " % (param, str(default[index])) + if spec.defaults[index] is not None: + default_values += "%s=%s " % (param, str(spec.defaults[index])) return syntax, comments, default_values @@ -1630,14 +1630,14 @@ class ConfigNode(object): @rtype: ([str...], bool, bool) ''' method = self.get_command_method(command) - parameters, args, kwargs, default = inspect.getargspec(method) - parameters = parameters[1:] - if args is not None: - free_pparams = args + spec = inspect.getfullargspec(method) + parameters = spec.args[1:] + if spec.varargs is not None: + free_pparams = spec.varargs else: free_pparams = False - if kwargs is not None: - free_kparams = kwargs + if spec.varkw is not None: + free_kparams = spec.varkw else: free_kparams = False self.shell.log.debug("Signature is %s, %s, %s." diff --git a/debian/changelog b/debian/changelog index 2a93a6f..94d3354 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +python-configshell-fb (1:1.1.28-2.1) unstable; urgency=medium + + [ Bas Couwenberg ] + * Non-maintainer upload. + * Add upstream patches to fix test failure with python3.11. + (Closes: #1028996) + + -- Sebastian Ramacher <[email protected]> Sat, 21 Jan 2023 21:29:09 +0100 + python-configshell-fb (1:1.1.28-2) unstable; urgency=medium * d/t/control: Remove "Tests" header. Use "@" as "Depends". diff --git a/debian/patches/replace-getargspec-with-getfullargspec.patch b/debian/patches/replace-getargspec-with-getfullargspec.patch new file mode 100644 index 0000000..8388066 --- /dev/null +++ b/debian/patches/replace-getargspec-with-getfullargspec.patch @@ -0,0 +1,31 @@ +Description: replace getargspec() with getfullargspec() + inspect.getargspec() doesn't work anymore with Python3.11 +Author: Maurizio Lombardi <[email protected]> +Origin: https://github.com/open-iscsi/configshell-fb/commit/f3ac914861bd605e3d634aeeb5e706abdbd39259 +Forwarded: not-needed +Bug-Debian: https://bugs.debian.org/1028996 + +--- a/configshell/node.py ++++ b/configshell/node.py +@@ -1417,10 +1417,10 @@ class ConfigNode(object): + @type kparams: dict + @raise ExecutionError: When the check fails. + ''' +- spec = inspect.getargspec(method) ++ spec = inspect.getfullargspec(method) + args = spec.args[1:] + pp = spec.varargs +- kw = spec.keywords ++ kw = spec.varkw + + if spec.defaults is None: + nb_opt_params = 0 +@@ -1460,7 +1460,7 @@ class ConfigNode(object): + "Missing required parameters %s" + % ", ".join("'%s'" % missing for missing in missing_params)) + +- if spec.keywords is None: ++ if kw is None: + if len(unexpected_keywords) == 1: + raise ExecutionError( + "Unexpected keyword parameter '%s'." diff --git a/debian/patches/replace-more-occurrences-of-getargspec-with-getfullargspec.patch b/debian/patches/replace-more-occurrences-of-getargspec-with-getfullargspec.patch new file mode 100644 index 0000000..b50db4e --- /dev/null +++ b/debian/patches/replace-more-occurrences-of-getargspec-with-getfullargspec.patch @@ -0,0 +1,70 @@ +Description: Replace more occurrences of getargspec() with getfullargspec() + Follow up for f3ac914861bd605e3d634aeeb5e706abdbd39259, getargspec was used at two more places. +Author: Vojtech Trefny <[email protected]> +Origin: https://github.com/open-iscsi/configshell-fb/commit/343e46cbbbed339c67fe969cdf443af4c979f43e +Forwarded: not-needed +Bug-Debian: https://bugs.debian.org/1028996 + +--- a/configshell/node.py ++++ b/configshell/node.py +@@ -1575,12 +1575,12 @@ class ConfigNode(object): + @type command: str + ''' + method = self.get_command_method(command) +- parameters, args, kwargs, default = inspect.getargspec(method) +- parameters = parameters[1:] +- if default is None: ++ spec = inspect.getfullargspec(method) ++ parameters = spec.args[1:] ++ if spec.defaults is None: + num_defaults = 0 + else: +- num_defaults = len(default) ++ num_defaults = len(spec.defaults) + + if num_defaults != 0: + required_parameters = parameters[:-num_defaults] +@@ -1605,16 +1605,16 @@ class ConfigNode(object): + syntax += optional_parameters_str + + comments = [] +- if args is not None: +- syntax += "[%s...] " % args +- if kwargs is not None: +- syntax += "[%s=value...] " % (kwargs) ++ if spec.varargs is not None: ++ syntax += "[%s...] " % spec.varargs ++ if spec.varkw is not None: ++ syntax += "[%s=value...] " % (spec.varkw) + + default_values = '' + if num_defaults > 0: + for index, param in enumerate(optional_parameters): +- if default[index] is not None: +- default_values += "%s=%s " % (param, str(default[index])) ++ if spec.defaults[index] is not None: ++ default_values += "%s=%s " % (param, str(spec.defaults[index])) + + return syntax, comments, default_values + +@@ -1630,14 +1630,14 @@ class ConfigNode(object): + @rtype: ([str...], bool, bool) + ''' + method = self.get_command_method(command) +- parameters, args, kwargs, default = inspect.getargspec(method) +- parameters = parameters[1:] +- if args is not None: +- free_pparams = args ++ spec = inspect.getfullargspec(method) ++ parameters = spec.args[1:] ++ if spec.varargs is not None: ++ free_pparams = spec.varargs + else: + free_pparams = False +- if kwargs is not None: +- free_kparams = kwargs ++ if spec.varkw is not None: ++ free_kparams = spec.varkw + else: + free_kparams = False + self.shell.log.debug("Signature is %s, %s, %s." diff --git a/debian/patches/series b/debian/patches/series index e69de29..0d2ee57 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -0,0 +1,2 @@ +replace-getargspec-with-getfullargspec.patch +replace-more-occurrences-of-getargspec-with-getfullargspec.patch |
