Exemple #1
0
 def purge(self, age_in_days):
     """Purge deleted rows older than a given age from miper tables."""
     age_in_days = int(age_in_days)
     if age_in_days <= 0:
         print(_("Must supply a positive, non-zero value for age"))
         exit(1)
     ctxt = context.get_admin_context()
     db.purge_deleted_rows(ctxt, age_in_days)
Exemple #2
0
def setup_profiler(binary, host):
    if CONF.profiler.profiler_enabled:
        _notifier = osprofiler.notifier.create(
            "Messaging", messaging,
            context.get_admin_context().to_dict(), rpc.TRANSPORT, "miper",
            binary, host)
        osprofiler.notifier.set(_notifier)
        LOG.warning(
            _LW("OSProfiler is enabled.\nIt means that person who knows "
                "any of hmac_keys that are specified in "
                "/etc/miper/api-paste.ini can trace his requests. \n"
                "In real life only operator can read this file so there "
                "is no security issue. Note that even if person can "
                "trigger profiler, only admin user can retrieve trace "
                "information.\n"
                "To disable OSprofiler set in miper.conf:\n"
                "[profiler]\nenabled=false"))
    else:
        osprofiler.web.disable()
Exemple #3
0
def get_test_admin_context():
    return context.get_admin_context()
Exemple #4
0
 def setUp(self):
     super(BaseTest, self).setUp()
     self.ctxt = context.get_admin_context()
Exemple #5
0
 def periodic_tasks(self, raise_on_error=False):
     """Tasks to be run at a periodic interval."""
     ctxt = context.get_admin_context()
     self.manager.periodic_tasks(ctxt, raise_on_error=raise_on_error)