nuka.tasks.apt

apt related tasks

nuka.tasks.apt.debconf_set_selections

nuka.tasks.apt.debconf_set_selections(selections=None, **kwargs)[source]

debconf-set-selections

Example:

res = await apt.debconf_set_selections(
    [('adduser', 'adduser/homedir-permission', 'true')]
)
assert bool(res)

nuka.tasks.apt.install

nuka.tasks.apt.install(packages=None, debconf=None, debian_frontend='noninteractive', debian_priority=None, update_cache=None, install_recommends=False, **kwargs)[source]

apt get install

Example:

res = await apt.install(['python'])
assert bool(res)

nuka.tasks.apt.list

nuka.tasks.apt.list(update_cache=None, **kwargs)[source]

This class is almost compatible with concurrent.futures.Future.

Differences:

  • result() and exception() do not take a timeout argument and raise an exception when the future isn’t done yet.
  • Callbacks registered with add_done_callback() are always called via the event loop’s call_soon_threadsafe().
  • This class is not compatible with the wait() and as_completed() methods in the concurrent.futures package.

(In Python 3.4 or later we may be able to unify the implementations.)

nuka.tasks.apt.source

nuka.tasks.apt.source(name=None, src=None, key=None, update=True, **kwargs)[source]

add an apt source

Example:

if 'wheezie' in host.hostname:
    n = 'wheezie'
elif 'jessie' in host.hostname:
    n = 'jessie'
else:
    n = 'stretch'
src = 'deb http://apt.dockerproject.org/repo/ debian-{0} main'.format(n)
res = await apt.source(
    name='docker',
    key='https://yum.dockerproject.org/gpg',
    src=src,
)
assert bool(res)
src = 'deb https://deb.bearstech.com/debian {0}-bearstech main'.format(n)
res = await apt.source(
    name='bearstech',
    key='https://deb.bearstech.com/bearstech-archive.gpg',
    src=src,
)
assert bool(res)

nuka.tasks.apt.update

nuka.tasks.apt.update(cache=None, **kwargs)[source]

apt get update

Example:

res = await apt.update(cache=3600)
assert bool(res)

nuka.tasks.apt.upgrade

nuka.tasks.apt.upgrade(packages=None, debconf=None, debian_frontend='noninteractive', **kwargs)[source]

This class is almost compatible with concurrent.futures.Future.

Differences:

  • result() and exception() do not take a timeout argument and raise an exception when the future isn’t done yet.
  • Callbacks registered with add_done_callback() are always called via the event loop’s call_soon_threadsafe().
  • This class is not compatible with the wait() and as_completed() methods in the concurrent.futures package.

(In Python 3.4 or later we may be able to unify the implementations.)