import logging
from subprocess import call
from provision.base import Provisioner
logger = logging.getLogger(__name__)


class UbuntuProvisioner(Provisioner):

    def install_distro_packages(self):
        logger.info('Installing Ubuntu Packages')
        packages = self.config.get('distro_packages')
        call(['apt-get', 'update'])
        cmd = ['apt-get', 'install', '--yes'] + packages
        retcode = call(cmd)
        if retcode != 0:
            raise OSError('Error installing packages')

    def install_user_packages(self):
        logger.info('Installing Ubuntu PPAs')
        packages = self.config.get('user_packages')
        for ppa in packages.values():
            call(['add-apt-repository', '--yes', ppa])
        call(['apt-get', 'update'])
        for package in packages:
            call(['apt-get', 'install', '--yes', package])

1d25948054035f3e70d9bb20e3086e752f9489da
<mask token>


class UbuntuProvisioner(Provisioner):
    <mask token>

    def install_user_packages(self):
        logger.info('Installing Ubuntu PPAs')
        packages = self.config.get('user_packages')
        for ppa in packages.values():
            call(['add-apt-repository', '--yes', ppa])
        call(['apt-get', 'update'])
        for package in packages:
            call(['apt-get', 'install', '--yes', package])

<mask token>


class UbuntuProvisioner(Provisioner):

    def install_distro_packages(self):
        logger.info('Installing Ubuntu Packages')
        packages = self.config.get('distro_packages')
        call(['apt-get', 'update'])
        cmd = ['apt-get', 'install', '--yes'] + packages
        retcode = call(cmd)
        if retcode != 0:
            raise OSError('Error installing packages')

    def install_user_packages(self):
        logger.info('Installing Ubuntu PPAs')
        packages = self.config.get('user_packages')
        for ppa in packages.values():
            call(['add-apt-repository', '--yes', ppa])
        call(['apt-get', 'update'])
        for package in packages:
            call(['apt-get', 'install', '--yes', package])

<mask token>
logger = logging.getLogger(__name__)


class UbuntuProvisioner(Provisioner):

    def install_distro_packages(self):
        logger.info('Installing Ubuntu Packages')
        packages = self.config.get('distro_packages')
        call(['apt-get', 'update'])
        cmd = ['apt-get', 'install', '--yes'] + packages
        retcode = call(cmd)
        if retcode != 0:
            raise OSError('Error installing packages')

    def install_user_packages(self):
        logger.info('Installing Ubuntu PPAs')
        packages = self.config.get('user_packages')
        for ppa in packages.values():
            call(['add-apt-repository', '--yes', ppa])
        call(['apt-get', 'update'])
        for package in packages:
            call(['apt-get', 'install', '--yes', package])

import logging
from subprocess import call
from provision.base import Provisioner
logger = logging.getLogger(__name__)


class UbuntuProvisioner(Provisioner):

    def install_distro_packages(self):
        logger.info('Installing Ubuntu Packages')
        packages = self.config.get('distro_packages')
        call(['apt-get', 'update'])
        cmd = ['apt-get', 'install', '--yes'] + packages
        retcode = call(cmd)
        if retcode != 0:
            raise OSError('Error installing packages')

    def install_user_packages(self):
        logger.info('Installing Ubuntu PPAs')
        packages = self.config.get('user_packages')
        for ppa in packages.values():
            call(['add-apt-repository', '--yes', ppa])
        call(['apt-get', 'update'])
        for package in packages:
            call(['apt-get', 'install', '--yes', package])
