PermissionError undefined on python 2.7

Bug #1831146 reported by Benjamin Dean on 2019-05-30
This bug affects 2 people
Affects Status Importance Assigned to Milestone

Bug Description

running cloud-init-18.5-1.el7.x86_64 on RHEL 7.7

as non-root user when I run `cloud-init status` I get the following error.

Traceback (most recent call last):
  File "/usr/bin/cloud-init", line 9, in <module>
    load_entry_point('cloud-init==18.5', 'console_scripts', 'cloud-init')()
  File "/usr/lib/python2.7/site-packages/cloudinit/cmd/", line 892, in main
    get_uptime=True, func=functor, args=(name, args))
  File "/usr/lib/python2.7/site-packages/cloudinit/", line 2520, in log_time
    ret = func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/cloudinit/cmd/", line 53, in handle_status_args
  File "/usr/lib/python2.7/site-packages/cloudinit/", line 175, in read_cfg
    self._cfg = self._read_cfg(extra_fns)
  File "/usr/lib/python2.7/site-packages/cloudinit/", line 184, in _read_cfg
    return merger.cfg
  File "/usr/lib/python2.7/site-packages/cloudinit/", line 278, in cfg
    self._cfg = self._read_cfg()
  File "/usr/lib/python2.7/site-packages/cloudinit/", line 268, in _read_cfg
  File "/usr/lib/python2.7/site-packages/cloudinit/", line 242, in _get_instance_configs
    except PermissionError:
NameError: global name 'PermissionError' is not defined

seems like it needs some workaround for python 2.7 similar to this one in some other project:

Benjamin Dean (bdean) wrote :

Here's the commit that added this PermissionError:

in 18.4

Ryan Harper (raharper) wrote :

Thanks for submitting the bug.

Changed in cloud-init:
importance: Undecided → Medium
status: New → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers