Skip to content

Instantly share code, notes, and snippets.

@corux
corux / sonar-cleanup.py
Created July 29, 2016 18:07
Script to automate the deletion of old projects from SonarQube.
#!/usr/bin/env python
import argparse,collections,json,shlex,urllib,re
from datetime import datetime
from datetime import timedelta
from dateutil.parser import parse
from termcolor import colored
# Command line arguments
parser = argparse.ArgumentParser()
parser.add_argument("--dry-run", dest="dryrun", action="store_const", const=True, default=False, help="Do not delete SonarQube projects.")
@corux
corux / update-version.py
Last active March 26, 2019 23:16
Script to update salt atlassian-[product]-formula to the latest released version.
#!/usr/bin/env python
import argparse,collections,json,shlex,subprocess,urllib,yaml
# Ordered YAML loading
def dict_representer(dumper, data):
return dumper.represent_dict(data.items())
def dict_constructor(loader, node):
return collections.OrderedDict(loader.construct_pairs(node))