Exemplo n.º 1
0
 def PLUGINEND(self, headers, body):
     logging.info("Uploading Package Profile")
     try:
         upload_package_profile()
     except:
         logging.error("Unable to upload Package Profile")
     self.ack()
Exemplo n.º 2
0
    def test_upload_registered(self, mock_lookup, mock_manager,
                               plugin_enabled):
        mock_lookup.return_value = True

        upload_package_profile()

        mock_manager.return_value.profilelib._do_update.assert_called()
Exemplo n.º 3
0
 def PLUGINEND(self, headers, body):
     logging.info("Uploading Package Profile")
     try:
         upload_package_profile()
     except:
         logging.error("Unable to upload Package Profile")
     self.ack()
Exemplo n.º 4
0
def posttrans_hook(conduit):
    if not conduit.confBool("main", "supress_debug"):
        conduit.info(2, "Uploading Package Profile")
    try:
        upload_package_profile()
    except:
        if not conduit.confBool("main", "supress_errors"):
            conduit.error(2, "Unable to upload Package Profile")
Exemplo n.º 5
0
    def transaction(self):
        conf = self.read_config(self.base.conf)
        enabled = (conf.has_section('main')
                   and conf.has_option('main', 'enabled')
                   and conf.getboolean('main', 'enabled'))

        if enabled:
            if (conf.has_option('main', 'supress_debug')
                    and not conf.getboolean('main', 'supress_debug')):
                logger.info("Uploading Package Profile")
            try:
                upload_package_profile()
            except Exception:
                if (conf.has_option('main', 'supress_errors')
                        and not conf.getboolean('main', 'supress_errors')):
                    logger.error("Unable to upload Package Profile")
Exemplo n.º 6
0
    def test_upload_unregistered(self, mock_lookup, mock_manager):
        mock_lookup.return_value = None

        upload_package_profile()

        mock_manager.assert_not_called()
Exemplo n.º 7
0
 def run(self):
     if self.opts.forceupload:
         purge_package_cache()
     upload_package_profile()