This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from johnny.middleware import QueryCacheMiddleware | |
from johnny.transaction import TransactionManager | |
from johnny.cache import QueryCacheBackend | |
from uuid import uuid4 | |
from django.db import connections, DEFAULT_DB_ALIAS, load_backend | |
# not correctness-critical, after expiry will force complete cache flush | |
XACT_TIMEOUT = 365 * 86400 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@task | |
def a_celery_task(pxid): | |
try: | |
do_something() | |
except Exception: | |
two_phase_commit.rollback_prepared(pxid) | |
else: | |
two_phase_commit.commit_prepared(pxid) | |
def defer_something(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Dpkg::Version; | |
use Getopt::Long; | |
my $head; | |
my $reverse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: $host | |
tasks: | |
- environment: | |
- debug: msg="{{ env_HOME }}" | |
- debug: msg="{{ environment.HOME }}" | |
- debug: msg="{{ environment }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
++<=++<=+<=++<=++<=+<=++<=++<=+<=++^^= | |
++<=++<=+<=++<=++<=+<=++<=++<=+<=++^= | |
<=++<=++<=++<=++<=++<=++<=++<=++<=++<=++^^ | |
<=++<=++<=++<=++<=++<=++<=++<=++<=++^ | |
++<=++<=+<=++<=++<=+<=++<=++<=+<=++^^= | |
++<=++<=+<=++<=++<=+<=++<=++<=+<=++^= | |
<=++<=++<=++<=++<=++<=++<=++<=++<=++<=++^^ | |
<=++<=++<=++<=++<=++<=++<=++<=++<=++^ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>VVVVVVV+^+^+^+^+^+>v+>v+>v+>^+>^+>^+V+V+V+V+V+ | |
<<+<+<+<+^+^+^+>+>+<<^+^+>+>+>+> | |
<+<+<+<+V+V+V+V+V+>+>+>+>+^+^+<+ | |
<<VV+^+^+^+^+^+ | |
<<+>+>+>+>+<<+V+V+V+V+V+ | |
>>>>><<+<+<+<+^+^+^+>+>+<<^+^+>+>+>+ | |
VVVVV+^+^+^+^+^+<+<+<+V+V+V+V+V+^^^>+>+ | |
<<<<VVV+^+^+^+^+^+>v+>v+>v+>^+>^+>^+V+V+V+V+V+ | |
infinite{.} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ansible import playbook, callbacks | |
def run_playbook(path, extra_vars): | |
stats = callbacks.AggregateStats() | |
playbook_cb = callbacks.PlaybookCallbacks(verbose=1) | |
runner_cb = callbacks.PlaybookRunnerCallbacks(stats, verbose=1) | |
pb = playbook.PlayBook( | |
playbook=path, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from ansible.inventory import Inventory | |
import os | |
import sys | |
def get_addr(hostname): | |
inv = Inventory() | |
host = inv.get_host(hostname) | |
if not host: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MAPPING = { | |
'_default_': { | |
'_all': {'enabled': False}, | |
'dynamic_templates': [ | |
{ | |
'analyzed_body': { | |
'match': 'body', | |
'match_mapping_type': 'string', | |
'mapping': { | |
'type': 'string', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ansible import playbook, callbacks | |
import logging | |
import pprint | |
class LoggingCallbacks(callbacks.PlaybookCallbacks): | |
def log(self, level, msg, *args, **kwargs): | |
logging.log(level, msg, *args, **kwargs) | |
def on_task_start(self, name, is_conditional): |
OlderNewer