Ejemplo n.º 1
0
    def run(self):
        if not is_rpm_installed('cups'):
            logging.warning(
                slogm(
                    'CUPS is not installed: no printer settings will be deployed'
                ))
            return

        self.cups_connection = cups.Connection()
        self.printers = storage_get_printers(self.storage, self.sid)

        if self.printers:
            for prn in self.printers:
                connect_printer(self.cups_connection, prn)
Ejemplo n.º 2
0
    def admin_context_apply(self):
        '''
        Perform printer configuration assigned for user.
        '''
        if not is_rpm_installed('cups'):
            logging.warning(
                slogm(
                    'CUPS is not installed: no printer settings will be deployed'
                ))
            return

        printers = storage_get_printers(self.storage, self.sid)

        if printers:
            for prn in printers:
                write_printer(prn)
Ejemplo n.º 3
0
    def apply(self):
        '''
        Perform configuration of printer which is assigned to computer.
        '''
        if not is_rpm_installed('cups'):
            logging.warning(
                slogm(
                    'CUPS is not installed: no printer settings will be deployed'
                ))
            return

        printers = storage_get_printers(self.storage,
                                        self.storage.get_info('machine_sid'))

        if printers:
            for prn in printers:
                write_printer(prn)
Ejemplo n.º 4
0
 def __init__(self):
     if not is_rpm_installed('adp'):
         raise PluginInitError(
             'adp is not installed - plugin cannot be initialized')
     logging.info(slogm('ADP plugin initialized'))
Ejemplo n.º 5
0
 def __init__(self):
     if not is_rpm_installed('adp'):
         raise PluginInitError(message_with_code('W5'))
     logging.info(slogm(message_with_code('D4')))