Mock chroot — python-copr 1.63 documentation

# Mock chroot

Mock chroot resources represents available chroots for builds. API provides only read-only access, since configuration of the build chroots is done by the service administrator.

Access to the mock chroots is done through `mock_chroots()`. property of initialized `CoprClient`. That property is an instance of `MockChrootHandle`. Mock chroots are represented by `MockChroot` class.

## Mock chroot entity attributes

Field | Type | Description
--- | --- | ---
name | str | chroot name
os_release | str | name of distribution system, e.g.: epel, fedora
os_version | str | version of distribution system, e.g.: 7, 22
arch | str | architecture of distribution, e.g.: i386, x86_64, ppc64le
is_active | bool | defines if this chroot is available for builds

Note

all following examples assume that we use `cl` as an instance of `client_v2.client.CoprClient`

## Get mock chroot list

    >>> mlist = map(str, cl.mock_chroots.get_list(active_only=True))
    >>> print("\n".join(map(str, mlist)))
    <Mock chroot: epel-6-i386 is active: True>
    <Mock chroot: epel-6-x86_64 is active: True>
    <Mock chroot: epel-5-i386 is active: True>
    ...

## Get single mock chroot

    >>> mc = cl.mock_chroots.get_one("fedora-22-i386")
    >>> print(mc)
    <Mock chroot: fedora-22-i386 is active: True>
    >>> print(mc.name,  mc.os_release, mc.os_version, mc.arch)
    (u'fedora-22-i386', u'fedora', u'22', u'i386')