Your message dated Fri, 10 Mar 2017 09:33:34 +0000
with message-id <[email protected]>
and subject line Bug#857337: fixed in reclass 1.4.1-2
has caused the Debian Bug report #857337,
regarding reclass: Please backport fix for UndefinedVariableError
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
857337: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=857337
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: reclass
Version: 1.4.1-1
Severity: normal
Tags: upstream

Hello,

when running reclass --nodeinfo on reclass that references variable
which is not defined, execution will fail with wrongly handled
exception where user cannot see what's wrong:

Traceback (most recent call last):
  File "/usr/bin/reclass", line 9, in <module>
    load_entry_point('reclass==1.4.1', 'console_scripts', 'reclass')()
  File "/usr/lib/python2.7/dist-packages/reclass/cli.py", line 35, in main
    data = reclass.nodeinfo(options.nodename)
  File "/usr/lib/python2.7/dist-packages/reclass/core.py", line 136, in nodeinfo
    return self._nodeinfo_as_dict(nodename, self._nodeinfo(nodename))
  File "/usr/lib/python2.7/dist-packages/reclass/core.py", line 122, in 
_nodeinfo
    ret.interpolate()
  File "/usr/lib/python2.7/dist-packages/reclass/datatypes/entity.py", line 65, 
in interpolate
    self._parameters.interpolate()
  File "/usr/lib/python2.7/dist-packages/reclass/datatypes/parameters.py", line 
180, in interpolate
    self._interpolate_inner(path, refvalue)
  File "/usr/lib/python2.7/dist-packages/reclass/datatypes/parameters.py", line 
219, in _interpolate_inner
    raise UndefinedVariableError(e.var, path)
AttributeError: 'UndefinedVariableError' object has no attribute 'var'

Correct output should be following:

Cannot resolve ${_param:cluster_vip_address_local} in the context of 
keepalived:cluster:instance:cicd_control_vip:addresses:0
Traceback (most recent call last):
  File 
"/usr/local/lib/python2.7/dist-packages/reclass/datatypes/parameters.py", line 
269, in _interpolate_inner
    new = refvalue.render(self._base)
  File "/usr/local/lib/python2.7/dist-packages/reclass/utils/refvalue.py", line 
110, in render
    return self._assemble(resolver)
  File "/usr/local/lib/python2.7/dist-packages/reclass/utils/refvalue.py", line 
97, in _assemble
    return resolver(self._refs[0])
  File "/usr/local/lib/python2.7/dist-packages/reclass/utils/refvalue.py", line 
109, in <lambda>
    resolver = lambda s: self._resolve(s, context)
  File "/usr/local/lib/python2.7/dist-packages/reclass/utils/refvalue.py", line 
83, in _resolve
    raise UndefinedVariableError(ref)
UndefinedVariableError

The fix is simple and issue annoying so I would prefer fixing it and ask
release team to unfreeze migration so it can be fixed in Stretch.. :-)

I wanted to prepare update but git repository isn't up to date (seems
that 1.4.1-1 is missing), anyway attaching patch. Please let me know
what you think (I am genunix at irc.debian.org if you want to discuss in
realtime).

Filip

-- System Information:
Debian Release: 9.0
  APT prefers testing
  APT policy: (400, 'testing'), (100, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.7.0-0.bpo.1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=cs_CZ.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
From 99fe726b4826d76c29fa341c41e4f1ba549f2ad0 Mon Sep 17 00:00:00 2001
From: Filip Pytloun <[email protected]>
Date: Fri, 10 Mar 2017 08:47:56 +0100
Subject: [PATCH] Backport UndefinedVariableError fix

---
 debian/changelog                                   |  9 +++++++
 debian/control                                     | 16 +++++++----
 ...edVariableError-which-had-uh-undefined-va.patch | 31 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 debian/reclass.links                               |  2 ++
 debian/watch                                       |  3 +++
 6 files changed, 57 insertions(+), 5 deletions(-)
 create mode 100644 debian/patches/0001-Fix-UndefinedVariableError-which-had-uh-undefined-va.patch
 create mode 100644 debian/patches/series
 create mode 100644 debian/reclass.links
 create mode 100644 debian/watch

diff --git a/debian/changelog b/debian/changelog
index 2b4b88a..343e586 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+reclass (1.4-2) unstable; urgency=medium
+
+  * d/patches: backport Fix UndefinedVariableError
+  * d/reclass.links: add links to /usr/bin/reclass-{salt,ansible}
+  * add d/watch file
+  * Add myself as uploader
+
+ -- Filip Pytloun <[email protected]>  Fri, 10 Mar 2017 08:45:53 +0100
+
 reclass (1.4-1) unstable; urgency=low
 
   * New upstream release (closes: #761952).
diff --git a/debian/control b/debian/control
index 225c29f..6da6966 100644
--- a/debian/control
+++ b/debian/control
@@ -2,8 +2,12 @@ Source: reclass
 Section: python
 Priority: extra
 Maintainer: martin f. krafft <[email protected]>
-Uploaders: Jonas Smedegaard <[email protected]>
-Build-Depends: python-setuptools, python, debhelper (>= 8.9.7), python-sphinx, python-yaml
+Uploaders: Jonas Smedegaard <[email protected]>, Filip Pytloun <[email protected]>
+Build-Depends: debhelper (>= 8.9.7),
+               python,
+               python-setuptools,
+               python-sphinx,
+               python-yaml
 Standards-Version: 3.9.6
 XS-Python-Version: all
 Homepage: http://reclass.pantsfullofunix.net/
@@ -13,7 +17,9 @@ Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/reclass.git?h=debian
 Package: reclass
 Architecture: all
 Section: admin
-Depends: python-reclass (= ${binary:Version}), ${misc:Depends}, ${python:Depends}
+Depends: python-reclass (= ${binary:Version}),
+         ${misc:Depends},
+         ${python:Depends}
 Suggests: reclass-doc
 Description: hierarchical inventory backend for configuration management systems
  reclass is an "external node classifier" (ENC) as can be used with automation
@@ -38,7 +44,7 @@ Description: hierarchical inventory backend for configuration management systems
 
 Package: python-reclass
 Architecture: all
-Depends: ${misc:Depends}, ${python:Depends}, python-pkg-resources
+Depends: python-pkg-resources, ${misc:Depends}, ${python:Depends}
 Description: hierarchical inventory backend for configuration management systems
  reclass is an "external node classifier" (ENC) as can be used with automation
  tools, such as Puppet, Salt, and Ansible. It is also a stand-alone tool for
@@ -61,7 +67,7 @@ Description: hierarchical inventory backend for configuration management systems
 Package: reclass-doc
 Architecture: all
 Section: doc
-Depends: ${sphinxdoc:Depends}, ${misc:Depends}
+Depends: ${misc:Depends}, ${sphinxdoc:Depends}
 Description: reclass documentation
  reclass is an "external node classifier" (ENC) as can be used with automation
  tools, such as Puppet, Salt, and Ansible. It is also a stand-alone tool for
diff --git a/debian/patches/0001-Fix-UndefinedVariableError-which-had-uh-undefined-va.patch b/debian/patches/0001-Fix-UndefinedVariableError-which-had-uh-undefined-va.patch
new file mode 100644
index 0000000..5928029
--- /dev/null
+++ b/debian/patches/0001-Fix-UndefinedVariableError-which-had-uh-undefined-va.patch
@@ -0,0 +1,31 @@
+From fbd22d42a20a0fdd53bc42fd27ad9f3d6af70f80 Mon Sep 17 00:00:00 2001
+From: Michael Kuty <[email protected]>
+Date: Fri, 16 Oct 2015 18:10:18 +0200
+Subject: [PATCH 1/2] Fix UndefinedVariableError, which had, uh, undefined
+ variables
+
+Signed-off-by: martin f. krafft <[email protected]>
+---
+ reclass/errors.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/reclass/errors.py b/reclass/errors.py
+index 4da2bc3..ddb95fd 100644
+--- a/reclass/errors.py
++++ b/reclass/errors.py
+@@ -131,9 +131,11 @@ class UndefinedVariableError(InterpolationError):
+         super(UndefinedVariableError, self).__init__(msg=None)
+         self._var = var
+         self._context = context
++    var = property(lambda self: self._var)
++    context = property(lambda self: self._context)
+ 
+     def _get_message(self):
+-        msg = "Cannot resolve " + var.join(PARAMETER_INTERPOLATION_SENTINELS)
++        msg = "Cannot resolve " + self._var.join(PARAMETER_INTERPOLATION_SENTINELS)
+         if self._context:
+             msg += ' in the context of %s' % self._context
+         return msg
+-- 
+2.1.4
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..a932daa
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Fix-UndefinedVariableError-which-had-uh-undefined-va.patch
diff --git a/debian/reclass.links b/debian/reclass.links
new file mode 100644
index 0000000..9a35c62
--- /dev/null
+++ b/debian/reclass.links
@@ -0,0 +1,2 @@
+/usr/share/reclass/reclass-ansible /usr/bin/reclass-ansible
+/usr/share/reclass/reclass-salt /usr/bin/reclass-salt
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..15d1a0c
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+version=3
+#opts=pgpsigurlmangle=s/$/.asc/ \
+https://pypi.debian.net/reclass/reclass-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
-- 
2.11.0

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Source: reclass
Source-Version: 1.4.1-2

We believe that the bug you reported is fixed in the latest version of
reclass, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Filip Pytloun <[email protected]> (supplier of updated reclass package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Fri, 10 Mar 2017 08:45:53 +0100
Source: reclass
Binary: reclass python-reclass reclass-doc
Architecture: source
Version: 1.4.1-2
Distribution: unstable
Urgency: medium
Maintainer: martin f. krafft <[email protected]>
Changed-By: Filip Pytloun <[email protected]>
Description:
 python-reclass - hierarchical inventory backend for configuration management 
syste
 reclass    - hierarchical inventory backend for configuration management syste
 reclass-doc - reclass documentation
Closes: 857337
Changes:
 reclass (1.4.1-2) unstable; urgency=medium
 .
   * d/patches: backport Fix UndefinedVariableError (Closes: #857337)
   * Add d/watch file
   * Raise d/compat to 10, update standards to 3.9.8
   * Add myself as uploader
Checksums-Sha1:
 7fd210893f16c766658071042e7a4d5f80e80bb2 2119 reclass_1.4.1-2.dsc
 12de080b984d92098811bae1af4d66561384e28c 6844 reclass_1.4.1-2.debian.tar.xz
 1bd03e7c624b29aa6923b8f849ea7b9aa3ea2ee7 5979 reclass_1.4.1-2_source.buildinfo
Checksums-Sha256:
 ba09061278f39c7ddbf73b9bcf066762cb0ca642e5da05607ee8d309db3bd808 2119 
reclass_1.4.1-2.dsc
 6955e44f17c72ca6c8dbfc34dfe9b9997c8c6a997fb99a1c7c5992363a03a115 6844 
reclass_1.4.1-2.debian.tar.xz
 187291afc5bd68ba31115fcf86730f266cb24f5cc8f6b565c5d57c44e88b305f 5979 
reclass_1.4.1-2_source.buildinfo
Files:
 2c1e1457a8b87ef597cce7c81131b6ed 2119 python extra reclass_1.4.1-2.dsc
 1ca64e4080ad88bd1c1b2776068c203f 6844 python extra 
reclass_1.4.1-2.debian.tar.xz
 80f7ef3337f4dba7f14cb5220a7b7e37 5979 python extra 
reclass_1.4.1-2_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJFBAEBCAAvFiEEOAKTsWyox6BpW4soaAgjm5xy5hsFAljCa+gRHGZpbGlwQHB5
dGxvdW4uY3oACgkQaAgjm5xy5huWgg//XWx+wPMAi/Itk/9H9AW3ZBMY2hhHqBnv
OJU43Dy95mxaTkusmtVKHr3BYNCZuP/3pVOi1YH/zWLz0XZ0WXxC8V0Jey7/ChxV
qKm250L862VEMUiH4OKDrc7Py/rIfCkhyKA+l/48k45eTzn2GRH2cU5XENeIwRPX
ihz9VmBUXCCgvzAenjeJXyTHmpd6TAhakNuvZsuZI5Ra+mR5+le/e/x1/oT0TKFJ
ym9Z+s5arGKMS31KrjaqxupOdtTB60mnyThfswhLgaOkxslIYS1L/hBb8sOkva36
3Gy+zdodPXs8Nnf5QqO7RV9SnzwLD++66Eqall45fRG5a/jAIn5nTHDJi38XWLmV
ecuQDJwhhhrDB/08575Kje751UqLSzc63AKv8RZH8zZeYbp8ShWug2GSJwYRPP6m
qms19CdEjsZs6tATVP3tusQaJEBI2DrDvAL6boOGy94iiD52m1l5NwHr58zjr/Qq
KZThTI2cyR+sJ/mjO2dOi5qzARi8mQoTyyni/VDjE4C6k19Elg8UhaiWT7VH69b6
txodxhehABG24qkios8CtFSIKPnF6jYVyhYDM9QtI+evk9c73C1iwmT4GeSI/FRz
wnHQuA0dD58jcuZ/rgxlk2V8jg6vh1itjT5uPpbyI0V0SSnFt967fgRyURWizG3c
Ke51MhH8Nww=
=11RA
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to