local variable 'rtd' referenced before assignment

Bug #1361350 reported by Jason Hobbs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
curtin
Fix Released
Critical
Jason Hobbs

Bug Description

Hit this bug trying to run a network_command via curtin:

root@cylindrical-joke:~/curtin# 'curtin' --showtrace 'install' '--config=configs/config-000.cfg' 'http://192.168.0.25/MAAS/static/images/ubuntu/amd64/generic/trusty/daily/root-tgz'
Traceback (most recent call last):
  File "/root/curtin/curtin/commands/main.py", line 96, in main
    sys.exit(args.func(args))
  File "/root/curtin/curtin/commands/in_target.py", line 61, in in_target_main
    with util.ChrootableTarget(target, allow_daemons=args.allow_daemons):
  File "/root/curtin/curtin/util.py", line 301, in __enter__
    if rtd:
UnboundLocalError: local variable 'rtd' referenced before assignment
local variable 'rtd' referenced before assignment
Traceback (most recent call last):
  File "/root/curtin/curtin/commands/main.py", line 96, in main
    sys.exit(args.func(args))
  File "/root/curtin/curtin/commands/install.py", line 267, in cmd_install
    stage.run()
  File "/root/curtin/curtin/commands/install.py", line 104, in run
    util.subp(cmd, shell=shell, env=self.env)
  File "/root/curtin/curtin/util.py", line 68, in subp
    cmd=args)
ProcessExecutionError: Unexpected error while running command.
Command: curtin in-target -- apt-get --assume-yes install bridge-utils
Exit code: 3

Turns out the tempfile.mkdtemp call that is suppose to set rtd is failing in this case, so rtd is never created, and when it's referenced in the except handler, we get the stacktrace above instead of something useful.

Changed in curtin:
status: New → In Progress
assignee: nobody → Jason Hobbs (jason-hobbs)
Changed in curtin:
importance: Undecided → Critical
Changed in curtin:
status: In Progress → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote : Fixed in Curtin 17.1

This bug is believed to be fixed in curtin in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in curtin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.