Update
This commit is contained in:
parent
43b6fe1719
commit
6ca38f092b
|
@ -272,7 +272,7 @@ class MailmanTraffic(ServiceMonitor):
|
|||
'Nov': '11',
|
||||
'Dec': '12',
|
||||
}}
|
||||
mailman_addr = re.compile(r'.*-(admin|bounces|confirm|join|leave|owner|request|subscribe|unsubscribe)@.*')
|
||||
mailman_addr = re.compile(r'.*-(admin|bounces|confirm|join|leave|owner|request|subscribe|unsubscribe)@.*|mailman@.*')
|
||||
|
||||
def prepare(object_id, list_name, ini_date):
|
||||
global lists
|
||||
|
@ -315,6 +315,7 @@ class MailmanTraffic(ServiceMonitor):
|
|||
ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
subscribers = ps.communicate()[0].strip()
|
||||
size *= int(subscribers)
|
||||
sys.stderr.write("%s %s*%s traffic*subscribers\\n" % (object_id, size, subscribers))
|
||||
print object_id, size
|
||||
""").format(**context)
|
||||
)
|
||||
|
|
|
@ -135,7 +135,7 @@ class BackendLogAdmin(ChangeViewActionsMixin, admin.ModelAdmin):
|
|||
'display_created', 'execution_time',
|
||||
)
|
||||
list_display_links = ('id', 'backend')
|
||||
list_filter = ('state', 'server', 'backend')
|
||||
list_filter = ('state', 'server', 'backend', 'operations__action')
|
||||
search_fields = ('script',)
|
||||
date_hierarchy = 'created_at'
|
||||
inlines = (BackendOperationInline,)
|
||||
|
|
|
@ -37,7 +37,7 @@ ORCHESTRATION_DISABLE_EXECUTION = Setting('ORCHESTRATION_DISABLE_EXECUTION',
|
|||
|
||||
|
||||
ORCHESTRATION_BACKEND_CLEANUP_DAYS = Setting('ORCHESTRATION_BACKEND_CLEANUP_DAYS',
|
||||
7
|
||||
20
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -45,17 +45,19 @@ class Last(Aggregation):
|
|||
|
||||
def aggregate_history(self, dataset):
|
||||
prev_object_id = None
|
||||
prev_object_repr = None
|
||||
for mdata in dataset.order_by('object_id', 'created_at'):
|
||||
object_id = mdata.object_id
|
||||
if object_id != prev_object_id:
|
||||
if prev_object_id is not None:
|
||||
yield (mdata.content_object_repr, datas)
|
||||
yield (prev_object_repr, datas)
|
||||
datas = [mdata]
|
||||
else:
|
||||
datas.append(mdata)
|
||||
prev_object_id = object_id
|
||||
prev_object_repr = mdata.content_object_repr
|
||||
if prev_object_id is not None:
|
||||
yield (mdata.content_object_repr, datas)
|
||||
yield (prev_object_repr, datas)
|
||||
|
||||
|
||||
class MonthlySum(Last):
|
||||
|
|
|
@ -87,7 +87,10 @@ class WordpressMuController(ServiceController):
|
|||
content = session.get(url, verify=self.VERIFY).content.decode('utf8')
|
||||
|
||||
wpnonce = re.compile('name="_wpnonce_add-blog"\s+value="([^"]*)"')
|
||||
try:
|
||||
wpnonce = wpnonce.search(content).groups()[0]
|
||||
except AttributeError:
|
||||
raise RuntimeError("wpnonce not foud in %s" % content)
|
||||
|
||||
url += '?action=add-site'
|
||||
data = {
|
||||
|
|
Loading…
Reference in New Issue