AttributeError: module 'curtin.util' has no attribute 'RunInChroot'

Bug #1617375 reported by Andres Rodriguez
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Fix Released
curtin (Ubuntu)
Fix Released
Fix Released

Bug Description


 * Curtin removed a previously used python module method,
   'RunInChroot' which was used by non-ubuntu curthooks for
   deploying OSes like CentOS. Removing the method prevents
   deploying CentOS where it worked prior to updating.

   Curtin has been updated to include an alias to the previous method that
   provides backward compat to callers of 'RunInChroot'

[Test Case]

 * Install proposed curtin package and deploy CentOS to target system

  PASS: CentOS deploys successfully.

  FAIL: CentOS deployment fails with message:

  AttributeError: module 'curtin.util' has no attribute 'RunInChroot'

[Regression Potential]

 * Other OSes besides CentOS may have used other flags against
   the original 'RunInChroot' method which is not being tested and
   may fail with the backward compat mode supporting 'RunInChroot'.

[Original Description]
I tested curtin bzr418 and bzr415, and I get the following error. This is a regression provided that it is not backward compatible and will cause all CentOS deployments via MAAS to fail.

MAAS injects curtin_hooks code to CentOS images that call such function. If users upgrade to the latest curtin, they wont be able to deploy CentOS.

AttributeError: module 'curtin.util' has no attribute 'RunInChroot'

curtin bzr418:

In [1]: import curtin.util

In [2]: curtin.util.RunInChroot
AttributeError Traceback (most recent call last)
<ipython-input-2-4e8269de26cc> in <module>()
----> 1 curtin.util.RunInChroot

AttributeError: module 'curtin.util' has no attribute 'RunInChroot'

curtin bzr399:

In [1]: import curtin.util

In [2]: curtin.util.RunInChroot
Out[2]: curtin.util.RunInChroot

Related branches

description: updated
no longer affects: maas-images
Revision history for this message
Ryan Harper (raharper) wrote :

bzr revno 404 introduced the change.

Changed in curtin:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

FYI - I can confirm but I think we need a discussion if this is a "bug" in the common sense.
Cause is

How much is curtin supposed to be stable as in ABI/API or not regarding those calls into it?
Up to smoser to discuss/decide I think.

Ryan Harper (raharper)
Changed in curtin:
status: Confirmed → Fix Committed
Changed in curtin (Ubuntu):
importance: Undecided → Critical
status: New → Fix Released
Changed in curtin (Ubuntu Xenial):
importance: Undecided → Critical
Ryan Harper (raharper)
description: updated
Revision history for this message
Andy Whitcroft (apw) wrote : Please test proposed package

Hello Andres, or anyone else affected,

Accepted curtin into xenial-proposed. The package will build now and be available at in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at . Thank you in advance!

Changed in curtin (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Nathaniel W. Turner (nturner) wrote :

Deploying a node with CentOS 7 and with CentOS 6 now succeeds.

Tested with:

maas* 2.1.0~beta2+bzr5454-0ubuntu1~16.04.1

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package curtin - 0.1.0~bzr425-0ubuntu1~16.04.1

curtin (0.1.0~bzr425-0ubuntu1~16.04.1) xenial-proposed; urgency=medium

  [ Scott Moser ]
  * debian/new-upstream-snapshot: add writing of debian changelog entries.

  [ Ryan Harper ]
  * New upstream snapshot.
    - unittest,tox.ini: catch and fix issue with trusty-level mock of open
    - block/mdadm: add option to ignore mdadm_assemble errors (LP: #1618429)
    - curtin/doc: overhaul curtin documentation for
      (LP: #1351085)
    - curtin.util: re-add support for RunInChroot (LP: #1617375)
    - curtin/net: overhaul of eni rendering to handle mixed ipv4/ipv6 configs
    - curtin.block: refactor clear_holders logic into block.clear_holders and
      cli cmd
    - curtin.apply_net should exit non-zero upon exception. (LP: #1615780)
    - apt: fix bug in disable_suites if sources.list line is blank.
    - vmtests: disable Wily in vmtests
    - Fix the unittests for test_apt_source.
    - get CURTIN_VMTEST_PARALLEL shown correctly in jenkins-runner output
    - fix vmtest check_file_strippedline to strip lines before comparing
    - fix whitespace damage in tests/vmtests/
    - fix dpkg-reconfigure when debconf_selections was provided.
      (LP: #1609614)
    - fix apt tests on non-intel arch
    - Add apt features to curtin. (LP: #1574113)
    - vmtest: easier use of parallel and controlling timeouts
    - mkfs.vfat: add force flag for formating whole disks (LP: #1597923)
    - block.mkfs: fix sectorsize flag (LP: #1597522)
    - block_meta: cleanup use of sys_block_path and handle cciss knames
      (LP: #1562249)
    - block.get_blockdev_sector_size: handle _lsblock multi result return
      (LP: #1598310)
    - util: add target (chroot) support to subp, add target_path helper.
    - block_meta: fallback to parted if blkid does not produce output
      (LP: #1524031)
    - commands.block_wipe: correct default wipe mode to 'superblock'
    - tox.ini: run coverage normally rather than separately
    - move uefi boot knowledge from launch and vmtest to xkvm

 -- Ryan Harper <email address hidden> Mon, 03 Oct 2016 13:43:54 -0500

Changed in curtin (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Update Released

The verification of the Stable Release Update for curtin has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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