partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
valid
Satchel.get_package_list
Returns a list of all required packages.
burlap/common.py
def get_package_list(self): """ Returns a list of all required packages. """ os_version = self.os_version # OS(type=LINUX, distro=UBUNTU, release='14.04') self.vprint('os_version:', os_version) # Lookup legacy package list. # OS: [package1, package2, ...], ...
def get_package_list(self): """ Returns a list of all required packages. """ os_version = self.os_version # OS(type=LINUX, distro=UBUNTU, release='14.04') self.vprint('os_version:', os_version) # Lookup legacy package list. # OS: [package1, package2, ...], ...
[ "Returns", "a", "list", "of", "all", "required", "packages", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/common.py#L1211-L1250
[ "def", "get_package_list", "(", "self", ")", ":", "os_version", "=", "self", ".", "os_version", "# OS(type=LINUX, distro=UBUNTU, release='14.04')", "self", ".", "vprint", "(", "'os_version:'", ",", "os_version", ")", "# Lookup legacy package list.", "# OS: [package1, packag...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
Satchel.install_packages
Installs all required packages listed for this satchel. Normally called indirectly by running packager.configure().
burlap/common.py
def install_packages(self): """ Installs all required packages listed for this satchel. Normally called indirectly by running packager.configure(). """ os_version = self.os_version package_list = self.get_package_list() if package_list: package_list_st...
def install_packages(self): """ Installs all required packages listed for this satchel. Normally called indirectly by running packager.configure(). """ os_version = self.os_version package_list = self.get_package_list() if package_list: package_list_st...
[ "Installs", "all", "required", "packages", "listed", "for", "this", "satchel", ".", "Normally", "called", "indirectly", "by", "running", "packager", ".", "configure", "()", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/common.py#L1252-L1268
[ "def", "install_packages", "(", "self", ")", ":", "os_version", "=", "self", ".", "os_version", "package_list", "=", "self", ".", "get_package_list", "(", ")", "if", "package_list", ":", "package_list_str", "=", "' '", ".", "join", "(", "package_list", ")", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
Satchel.run_on_all_sites
Like run(), but re-runs the command for each site in the current role.
burlap/common.py
def run_on_all_sites(self, cmd, *args, **kwargs): """ Like run(), but re-runs the command for each site in the current role. """ r = self.local_renderer for _site, _data in iter_sites(): r.env.SITE = _site with self.settings(warn_only=True): ...
def run_on_all_sites(self, cmd, *args, **kwargs): """ Like run(), but re-runs the command for each site in the current role. """ r = self.local_renderer for _site, _data in iter_sites(): r.env.SITE = _site with self.settings(warn_only=True): ...
[ "Like", "run", "()", "but", "re", "-", "runs", "the", "command", "for", "each", "site", "in", "the", "current", "role", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/common.py#L1335-L1343
[ "def", "run_on_all_sites", "(", "self", ",", "cmd", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "r", "=", "self", ".", "local_renderer", "for", "_site", ",", "_data", "in", "iter_sites", "(", ")", ":", "r", ".", "env", ".", "SITE", "=", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
Satchel.file_contains
filename text http://docs.fabfile.org/en/1.13/api/contrib/files.html#fabric.contrib.files.contains
burlap/common.py
def file_contains(self, *args, **kwargs): """ filename text http://docs.fabfile.org/en/1.13/api/contrib/files.html#fabric.contrib.files.contains """ from fabric.contrib.files import contains return contains(*args, **kwargs)
def file_contains(self, *args, **kwargs): """ filename text http://docs.fabfile.org/en/1.13/api/contrib/files.html#fabric.contrib.files.contains """ from fabric.contrib.files import contains return contains(*args, **kwargs)
[ "filename", "text", "http", ":", "//", "docs", ".", "fabfile", ".", "org", "/", "en", "/", "1", ".", "13", "/", "api", "/", "contrib", "/", "files", ".", "html#fabric", ".", "contrib", ".", "files", ".", "contains" ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/common.py#L1355-L1361
[ "def", "file_contains", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "from", "fabric", ".", "contrib", ".", "files", "import", "contains", "return", "contains", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
Satchel.record_manifest
Returns a dictionary representing a serialized state of the service.
burlap/common.py
def record_manifest(self): """ Returns a dictionary representing a serialized state of the service. """ manifest = get_component_settings(prefixes=[self.name]) # Record a signature of each template so we know to redeploy when they change. for template in self.get_templat...
def record_manifest(self): """ Returns a dictionary representing a serialized state of the service. """ manifest = get_component_settings(prefixes=[self.name]) # Record a signature of each template so we know to redeploy when they change. for template in self.get_templat...
[ "Returns", "a", "dictionary", "representing", "a", "serialized", "state", "of", "the", "service", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/common.py#L1414-L1442
[ "def", "record_manifest", "(", "self", ")", ":", "manifest", "=", "get_component_settings", "(", "prefixes", "=", "[", "self", ".", "name", "]", ")", "# Record a signature of each template so we know to redeploy when they change.", "for", "template", "in", "self", ".", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
Satchel.has_changes
Returns true if at least one tracker detects a change.
burlap/common.py
def has_changes(self): """ Returns true if at least one tracker detects a change. """ lm = self.last_manifest for tracker in self.get_trackers(): last_thumbprint = lm['_tracker_%s' % tracker.get_natural_key_hash()] if tracker.is_changed(last_thumbprint): ...
def has_changes(self): """ Returns true if at least one tracker detects a change. """ lm = self.last_manifest for tracker in self.get_trackers(): last_thumbprint = lm['_tracker_%s' % tracker.get_natural_key_hash()] if tracker.is_changed(last_thumbprint): ...
[ "Returns", "true", "if", "at", "least", "one", "tracker", "detects", "a", "change", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/common.py#L1445-L1454
[ "def", "has_changes", "(", "self", ")", ":", "lm", "=", "self", ".", "last_manifest", "for", "tracker", "in", "self", ".", "get_trackers", "(", ")", ":", "last_thumbprint", "=", "lm", "[", "'_tracker_%s'", "%", "tracker", ".", "get_natural_key_hash", "(", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
Satchel.configure
The standard method called to apply functionality when the manifest changes.
burlap/common.py
def configure(self): """ The standard method called to apply functionality when the manifest changes. """ lm = self.last_manifest for tracker in self.get_trackers(): self.vprint('Checking tracker:', tracker) last_thumbprint = lm['_tracker_%s' % tracker.get...
def configure(self): """ The standard method called to apply functionality when the manifest changes. """ lm = self.last_manifest for tracker in self.get_trackers(): self.vprint('Checking tracker:', tracker) last_thumbprint = lm['_tracker_%s' % tracker.get...
[ "The", "standard", "method", "called", "to", "apply", "functionality", "when", "the", "manifest", "changes", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/common.py#L1456-L1469
[ "def", "configure", "(", "self", ")", ":", "lm", "=", "self", ".", "last_manifest", "for", "tracker", "in", "self", ".", "get_trackers", "(", ")", ":", "self", ".", "vprint", "(", "'Checking tracker:'", ",", "tracker", ")", "last_thumbprint", "=", "lm", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
user_exists
Check if a PostgreSQL user exists.
burlap/postgresql.py
def user_exists(name): """ Check if a PostgreSQL user exists. """ with settings(hide('running', 'stdout', 'stderr', 'warnings'), warn_only=True): res = _run_as_pg('''psql -t -A -c "SELECT COUNT(*) FROM pg_user WHERE usename = '%(name)s';"''' % locals()) return (res == "1")
def user_exists(name): """ Check if a PostgreSQL user exists. """ with settings(hide('running', 'stdout', 'stderr', 'warnings'), warn_only=True): res = _run_as_pg('''psql -t -A -c "SELECT COUNT(*) FROM pg_user WHERE usename = '%(name)s';"''' % locals()) return (res == "1")
[ "Check", "if", "a", "PostgreSQL", "user", "exists", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/postgresql.py#L32-L39
[ "def", "user_exists", "(", "name", ")", ":", "with", "settings", "(", "hide", "(", "'running'", ",", "'stdout'", ",", "'stderr'", ",", "'warnings'", ")", ",", "warn_only", "=", "True", ")", ":", "res", "=", "_run_as_pg", "(", "'''psql -t -A -c \"SELECT COUNT...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
create_user
Create a PostgreSQL user. Example:: import burlap # Create DB user if it does not exist if not burlap.postgres.user_exists('dbuser'): burlap.postgres.create_user('dbuser', password='somerandomstring') # Create DB user with custom options burlap.postgres.create...
burlap/postgresql.py
def create_user(name, password, superuser=False, createdb=False, createrole=False, inherit=True, login=True, connection_limit=None, encrypted_password=False): """ Create a PostgreSQL user. Example:: import burlap # Create DB user if it does not exist ...
def create_user(name, password, superuser=False, createdb=False, createrole=False, inherit=True, login=True, connection_limit=None, encrypted_password=False): """ Create a PostgreSQL user. Example:: import burlap # Create DB user if it does not exist ...
[ "Create", "a", "PostgreSQL", "user", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/postgresql.py#L42-L73
[ "def", "create_user", "(", "name", ",", "password", ",", "superuser", "=", "False", ",", "createdb", "=", "False", ",", "createrole", "=", "False", ",", "inherit", "=", "True", ",", "login", "=", "True", ",", "connection_limit", "=", "None", ",", "encryp...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PostgreSQLSatchel.write_pgpass
Write the file used to store login credentials for PostgreSQL.
burlap/postgresql.py
def write_pgpass(self, name=None, site=None, use_sudo=0, root=0): """ Write the file used to store login credentials for PostgreSQL. """ r = self.database_renderer(name=name, site=site) root = int(root) use_sudo = int(use_sudo) r.run('touch {pgpass_path}') ...
def write_pgpass(self, name=None, site=None, use_sudo=0, root=0): """ Write the file used to store login credentials for PostgreSQL. """ r = self.database_renderer(name=name, site=site) root = int(root) use_sudo = int(use_sudo) r.run('touch {pgpass_path}') ...
[ "Write", "the", "file", "used", "to", "store", "login", "credentials", "for", "PostgreSQL", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/postgresql.py#L221-L248
[ "def", "write_pgpass", "(", "self", ",", "name", "=", "None", ",", "site", "=", "None", ",", "use_sudo", "=", "0", ",", "root", "=", "0", ")", ":", "r", "=", "self", ".", "database_renderer", "(", "name", "=", "name", ",", "site", "=", "site", ")...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PostgreSQLSatchel.dumpload
Dumps and loads a database snapshot simultaneously. Requires that the destination server has direct database access to the source server. This is better than a serial dump+load when: 1. The network connection is reliable. 2. You don't need to save the dump file. The ben...
burlap/postgresql.py
def dumpload(self, site=None, role=None): """ Dumps and loads a database snapshot simultaneously. Requires that the destination server has direct database access to the source server. This is better than a serial dump+load when: 1. The network connection is reliable. ...
def dumpload(self, site=None, role=None): """ Dumps and loads a database snapshot simultaneously. Requires that the destination server has direct database access to the source server. This is better than a serial dump+load when: 1. The network connection is reliable. ...
[ "Dumps", "and", "loads", "a", "database", "snapshot", "simultaneously", ".", "Requires", "that", "the", "destination", "server", "has", "direct", "database", "access", "to", "the", "source", "server", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/postgresql.py#L251-L270
[ "def", "dumpload", "(", "self", ",", "site", "=", "None", ",", "role", "=", "None", ")", ":", "r", "=", "self", ".", "database_renderer", "(", "site", "=", "site", ",", "role", "=", "role", ")", "r", ".", "run", "(", "'pg_dump -c --host={host_string} -...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PostgreSQLSatchel.exists
Returns true if a database with the given name exists. False otherwise.
burlap/postgresql.py
def exists(self, name='default', site=None, use_root=False): """ Returns true if a database with the given name exists. False otherwise. """ r = self.database_renderer(name=name, site=site) if int(use_root): kwargs = dict( db_user=r.env.get('db_root_...
def exists(self, name='default', site=None, use_root=False): """ Returns true if a database with the given name exists. False otherwise. """ r = self.database_renderer(name=name, site=site) if int(use_root): kwargs = dict( db_user=r.env.get('db_root_...
[ "Returns", "true", "if", "a", "database", "with", "the", "given", "name", "exists", ".", "False", "otherwise", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/postgresql.py#L298-L334
[ "def", "exists", "(", "self", ",", "name", "=", "'default'", ",", "site", "=", "None", ",", "use_root", "=", "False", ")", ":", "r", "=", "self", ".", "database_renderer", "(", "name", "=", "name", ",", "site", "=", "site", ")", "if", "int", "(", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PostgreSQLSatchel.load
Restores a database snapshot onto the target database server. If prep_only=1, commands for preparing the load will be generated, but not the command to finally load the snapshot.
burlap/postgresql.py
def load(self, dump_fn='', prep_only=0, force_upload=0, from_local=0, name=None, site=None, dest_dir=None, force_host=None): """ Restores a database snapshot onto the target database server. If prep_only=1, commands for preparing the load will be generated, but not the command to finall...
def load(self, dump_fn='', prep_only=0, force_upload=0, from_local=0, name=None, site=None, dest_dir=None, force_host=None): """ Restores a database snapshot onto the target database server. If prep_only=1, commands for preparing the load will be generated, but not the command to finall...
[ "Restores", "a", "database", "snapshot", "onto", "the", "target", "database", "server", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/postgresql.py#L376-L450
[ "def", "load", "(", "self", ",", "dump_fn", "=", "''", ",", "prep_only", "=", "0", ",", "force_upload", "=", "0", ",", "from_local", "=", "0", ",", "name", "=", "None", ",", "site", "=", "None", ",", "dest_dir", "=", "None", ",", "force_host", "=",...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PostgreSQLSatchel.shell
Opens a SQL shell to the given database, assuming the configured database and user supports this feature.
burlap/postgresql.py
def shell(self, name='default', site=None, **kwargs): """ Opens a SQL shell to the given database, assuming the configured database and user supports this feature. """ r = self.database_renderer(name=name, site=site) self.write_pgpass(name=name, site=site, root=True) ...
def shell(self, name='default', site=None, **kwargs): """ Opens a SQL shell to the given database, assuming the configured database and user supports this feature. """ r = self.database_renderer(name=name, site=site) self.write_pgpass(name=name, site=site, root=True) ...
[ "Opens", "a", "SQL", "shell", "to", "the", "given", "database", "assuming", "the", "configured", "database", "and", "user", "supports", "this", "feature", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/postgresql.py#L453-L466
[ "def", "shell", "(", "self", ",", "name", "=", "'default'", ",", "site", "=", "None", ",", "*", "*", "kwargs", ")", ":", "r", "=", "self", ".", "database_renderer", "(", "name", "=", "name", ",", "site", "=", "site", ")", "self", ".", "write_pgpass...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PostgreSQLSatchel.drop_database
Delete a PostgreSQL database. Example:: import burlap # Remove DB if it exists if burlap.postgres.database_exists('myapp'): burlap.postgres.drop_database('myapp')
burlap/postgresql.py
def drop_database(self, name): """ Delete a PostgreSQL database. Example:: import burlap # Remove DB if it exists if burlap.postgres.database_exists('myapp'): burlap.postgres.drop_database('myapp') """ with settings(warn_onl...
def drop_database(self, name): """ Delete a PostgreSQL database. Example:: import burlap # Remove DB if it exists if burlap.postgres.database_exists('myapp'): burlap.postgres.drop_database('myapp') """ with settings(warn_onl...
[ "Delete", "a", "PostgreSQL", "database", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/postgresql.py#L476-L490
[ "def", "drop_database", "(", "self", ",", "name", ")", ":", "with", "settings", "(", "warn_only", "=", "True", ")", ":", "self", ".", "sudo", "(", "'dropdb %s'", "%", "(", "name", ",", ")", ",", "user", "=", "'postgres'", ")" ]
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PostgreSQLSatchel.load_table
Directly transfers a table between two databases.
burlap/postgresql.py
def load_table(self, table_name, src, dst='localhost', name=None, site=None): """ Directly transfers a table between two databases. """ #TODO: incomplete r = self.database_renderer(name=name, site=site) r.env.table_name = table_name r.run('psql --user={dst_db_user...
def load_table(self, table_name, src, dst='localhost', name=None, site=None): """ Directly transfers a table between two databases. """ #TODO: incomplete r = self.database_renderer(name=name, site=site) r.env.table_name = table_name r.run('psql --user={dst_db_user...
[ "Directly", "transfers", "a", "table", "between", "two", "databases", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/postgresql.py#L509-L517
[ "def", "load_table", "(", "self", ",", "table_name", ",", "src", ",", "dst", "=", "'localhost'", ",", "name", "=", "None", ",", "site", "=", "None", ")", ":", "#TODO: incomplete", "r", "=", "self", ".", "database_renderer", "(", "name", "=", "name", ",...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
set_cwd
Usage: with set_cwd('/some/dir'): walk_around_the_filesystem()
burlap/context.py
def set_cwd(new_path): """ Usage: with set_cwd('/some/dir'): walk_around_the_filesystem() """ try: curdir = os.getcwd() except OSError: curdir = new_path try: os.chdir(new_path) yield finally: os.chdir(curdir)
def set_cwd(new_path): """ Usage: with set_cwd('/some/dir'): walk_around_the_filesystem() """ try: curdir = os.getcwd() except OSError: curdir = new_path try: os.chdir(new_path) yield finally: os.chdir(curdir)
[ "Usage", ":" ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/context.py#L8-L23
[ "def", "set_cwd", "(", "new_path", ")", ":", "try", ":", "curdir", "=", "os", ".", "getcwd", "(", ")", "except", "OSError", ":", "curdir", "=", "new_path", "try", ":", "os", ".", "chdir", "(", "new_path", ")", "yield", "finally", ":", "os", ".", "c...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
interfaces
Get the list of network interfaces. Will return all datalinks on SmartOS.
burlap/network.py
def interfaces(): """ Get the list of network interfaces. Will return all datalinks on SmartOS. """ with settings(hide('running', 'stdout')): if is_file('/usr/sbin/dladm'): res = run('/usr/sbin/dladm show-link') else: res = sudo('/sbin/ifconfig -s') return [li...
def interfaces(): """ Get the list of network interfaces. Will return all datalinks on SmartOS. """ with settings(hide('running', 'stdout')): if is_file('/usr/sbin/dladm'): res = run('/usr/sbin/dladm show-link') else: res = sudo('/sbin/ifconfig -s') return [li...
[ "Get", "the", "list", "of", "network", "interfaces", ".", "Will", "return", "all", "datalinks", "on", "SmartOS", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/network.py#L13-L22
[ "def", "interfaces", "(", ")", ":", "with", "settings", "(", "hide", "(", "'running'", ",", "'stdout'", ")", ")", ":", "if", "is_file", "(", "'/usr/sbin/dladm'", ")", ":", "res", "=", "run", "(", "'/usr/sbin/dladm show-link'", ")", "else", ":", "res", "=...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
address
Get the IPv4 address assigned to an interface. Example:: import burlap # Print all configured IP addresses for interface in burlap.network.interfaces(): print(burlap.network.address(interface))
burlap/network.py
def address(interface): """ Get the IPv4 address assigned to an interface. Example:: import burlap # Print all configured IP addresses for interface in burlap.network.interfaces(): print(burlap.network.address(interface)) """ with settings(hide('running', 'std...
def address(interface): """ Get the IPv4 address assigned to an interface. Example:: import burlap # Print all configured IP addresses for interface in burlap.network.interfaces(): print(burlap.network.address(interface)) """ with settings(hide('running', 'std...
[ "Get", "the", "IPv4", "address", "assigned", "to", "an", "interface", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/network.py#L25-L42
[ "def", "address", "(", "interface", ")", ":", "with", "settings", "(", "hide", "(", "'running'", ",", "'stdout'", ")", ")", ":", "res", "=", "(", "sudo", "(", "\"/sbin/ifconfig %(interface)s | grep 'inet '\"", "%", "locals", "(", ")", ")", "or", "''", ")",...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PackagerSatchel.record_manifest
Returns a dictionary representing a serialized state of the service.
burlap/packager.py
def record_manifest(self): """ Returns a dictionary representing a serialized state of the service. """ data = {} data['required_packages'] = self.install_required(type=SYSTEM, verbose=False, list_only=True) data['required_packages'].sort() data['custom_packages']...
def record_manifest(self): """ Returns a dictionary representing a serialized state of the service. """ data = {} data['required_packages'] = self.install_required(type=SYSTEM, verbose=False, list_only=True) data['required_packages'].sort() data['custom_packages']...
[ "Returns", "a", "dictionary", "representing", "a", "serialized", "state", "of", "the", "service", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/packager.py#L29-L39
[ "def", "record_manifest", "(", "self", ")", ":", "data", "=", "{", "}", "data", "[", "'required_packages'", "]", "=", "self", ".", "install_required", "(", "type", "=", "SYSTEM", ",", "verbose", "=", "False", ",", "list_only", "=", "True", ")", "data", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PackagerSatchel.update
Preparse the packaging system for installations.
burlap/packager.py
def update(self): """ Preparse the packaging system for installations. """ packager = self.packager if packager == APT: self.sudo('DEBIAN_FRONTEND=noninteractive apt-get -yq update') elif packager == YUM: self.sudo('yum update') else: ...
def update(self): """ Preparse the packaging system for installations. """ packager = self.packager if packager == APT: self.sudo('DEBIAN_FRONTEND=noninteractive apt-get -yq update') elif packager == YUM: self.sudo('yum update') else: ...
[ "Preparse", "the", "packaging", "system", "for", "installations", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/packager.py#L42-L52
[ "def", "update", "(", "self", ")", ":", "packager", "=", "self", ".", "packager", "if", "packager", "==", "APT", ":", "self", ".", "sudo", "(", "'DEBIAN_FRONTEND=noninteractive apt-get -yq update'", ")", "elif", "packager", "==", "YUM", ":", "self", ".", "su...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PackagerSatchel.install_apt
Installs system packages listed in apt-requirements.txt.
burlap/packager.py
def install_apt(self, fn=None, package_name=None, update=0, list_only=0): """ Installs system packages listed in apt-requirements.txt. """ r = self.local_renderer assert self.genv[ROLE] apt_req_fqfn = fn or (self.env.apt_requirments_fn and self.find_template(self.env.apt_...
def install_apt(self, fn=None, package_name=None, update=0, list_only=0): """ Installs system packages listed in apt-requirements.txt. """ r = self.local_renderer assert self.genv[ROLE] apt_req_fqfn = fn or (self.env.apt_requirments_fn and self.find_template(self.env.apt_...
[ "Installs", "system", "packages", "listed", "in", "apt", "-", "requirements", ".", "txt", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/packager.py#L55-L82
[ "def", "install_apt", "(", "self", ",", "fn", "=", "None", ",", "package_name", "=", "None", ",", "update", "=", "0", ",", "list_only", "=", "0", ")", ":", "r", "=", "self", ".", "local_renderer", "assert", "self", ".", "genv", "[", "ROLE", "]", "a...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PackagerSatchel.install_yum
Installs system packages listed in yum-requirements.txt.
burlap/packager.py
def install_yum(self, fn=None, package_name=None, update=0, list_only=0): """ Installs system packages listed in yum-requirements.txt. """ assert self.genv[ROLE] yum_req_fn = fn or self.find_template(self.genv.yum_requirments_fn) if not yum_req_fn: return [] ...
def install_yum(self, fn=None, package_name=None, update=0, list_only=0): """ Installs system packages listed in yum-requirements.txt. """ assert self.genv[ROLE] yum_req_fn = fn or self.find_template(self.genv.yum_requirments_fn) if not yum_req_fn: return [] ...
[ "Installs", "system", "packages", "listed", "in", "yum", "-", "requirements", ".", "txt", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/packager.py#L85-L109
[ "def", "install_yum", "(", "self", ",", "fn", "=", "None", ",", "package_name", "=", "None", ",", "update", "=", "0", ",", "list_only", "=", "0", ")", ":", "assert", "self", ".", "genv", "[", "ROLE", "]", "yum_req_fn", "=", "fn", "or", "self", ".",...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PackagerSatchel.install_custom
Installs all system packages listed in the appropriate <packager>-requirements.txt.
burlap/packager.py
def install_custom(self, *args, **kwargs): """ Installs all system packages listed in the appropriate <packager>-requirements.txt. """ if not self.env.manage_custom: return packager = self.packager if packager == APT: return self.install_ap...
def install_custom(self, *args, **kwargs): """ Installs all system packages listed in the appropriate <packager>-requirements.txt. """ if not self.env.manage_custom: return packager = self.packager if packager == APT: return self.install_ap...
[ "Installs", "all", "system", "packages", "listed", "in", "the", "appropriate", "<packager", ">", "-", "requirements", ".", "txt", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/packager.py#L112-L125
[ "def", "install_custom", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "not", "self", ".", "env", ".", "manage_custom", ":", "return", "packager", "=", "self", ".", "packager", "if", "packager", "==", "APT", ":", "return", "...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PackagerSatchel.refresh
Updates/upgrades all system packages.
burlap/packager.py
def refresh(self, *args, **kwargs): """ Updates/upgrades all system packages. """ r = self.local_renderer packager = self.packager if packager == APT: r.sudo('DEBIAN_FRONTEND=noninteractive apt-get -yq update --fix-missing') elif packager == YUM: ...
def refresh(self, *args, **kwargs): """ Updates/upgrades all system packages. """ r = self.local_renderer packager = self.packager if packager == APT: r.sudo('DEBIAN_FRONTEND=noninteractive apt-get -yq update --fix-missing') elif packager == YUM: ...
[ "Updates", "/", "upgrades", "all", "system", "packages", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/packager.py#L143-L155
[ "def", "refresh", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "r", "=", "self", ".", "local_renderer", "packager", "=", "self", ".", "packager", "if", "packager", "==", "APT", ":", "r", ".", "sudo", "(", "'DEBIAN_FRONTEND=noninter...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PackagerSatchel.upgrade
Updates/upgrades all system packages.
burlap/packager.py
def upgrade(self, full=0): """ Updates/upgrades all system packages. """ full = int(full) r = self.local_renderer packager = self.packager if packager == APT: r.sudo('DEBIAN_FRONTEND=noninteractive apt-get -yq upgrade') if full: ...
def upgrade(self, full=0): """ Updates/upgrades all system packages. """ full = int(full) r = self.local_renderer packager = self.packager if packager == APT: r.sudo('DEBIAN_FRONTEND=noninteractive apt-get -yq upgrade') if full: ...
[ "Updates", "/", "upgrades", "all", "system", "packages", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/packager.py#L158-L172
[ "def", "upgrade", "(", "self", ",", "full", "=", "0", ")", ":", "full", "=", "int", "(", "full", ")", "r", "=", "self", ".", "local_renderer", "packager", "=", "self", ".", "packager", "if", "packager", "==", "APT", ":", "r", ".", "sudo", "(", "'...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PackagerSatchel.list_required
Displays all packages required by the current role based on the documented services provided.
burlap/packager.py
def list_required(self, type=None, service=None): # pylint: disable=redefined-builtin """ Displays all packages required by the current role based on the documented services provided. """ from burlap.common import ( required_system_packages, required_pytho...
def list_required(self, type=None, service=None): # pylint: disable=redefined-builtin """ Displays all packages required by the current role based on the documented services provided. """ from burlap.common import ( required_system_packages, required_pytho...
[ "Displays", "all", "packages", "required", "by", "the", "current", "role", "based", "on", "the", "documented", "services", "provided", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/packager.py#L249-L325
[ "def", "list_required", "(", "self", ",", "type", "=", "None", ",", "service", "=", "None", ")", ":", "# pylint: disable=redefined-builtin", "from", "burlap", ".", "common", "import", "(", "required_system_packages", ",", "required_python_packages", ",", "required_r...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PackagerSatchel.install_required
Installs system packages listed as required by services this host uses.
burlap/packager.py
def install_required(self, type=None, service=None, list_only=0, **kwargs): # pylint: disable=redefined-builtin """ Installs system packages listed as required by services this host uses. """ r = self.local_renderer list_only = int(list_only) type = (type or '').lower().s...
def install_required(self, type=None, service=None, list_only=0, **kwargs): # pylint: disable=redefined-builtin """ Installs system packages listed as required by services this host uses. """ r = self.local_renderer list_only = int(list_only) type = (type or '').lower().s...
[ "Installs", "system", "packages", "listed", "as", "required", "by", "services", "this", "host", "uses", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/packager.py#L358-L386
[ "def", "install_required", "(", "self", ",", "type", "=", "None", ",", "service", "=", "None", ",", "list_only", "=", "0", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=redefined-builtin", "r", "=", "self", ".", "local_renderer", "list_only", "=", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
PackagerSatchel.uninstall_blacklisted
Uninstalls all blacklisted packages.
burlap/packager.py
def uninstall_blacklisted(self): """ Uninstalls all blacklisted packages. """ from burlap.system import distrib_family blacklisted_packages = self.env.blacklisted_packages if not blacklisted_packages: print('No blacklisted packages.') return ...
def uninstall_blacklisted(self): """ Uninstalls all blacklisted packages. """ from burlap.system import distrib_family blacklisted_packages = self.env.blacklisted_packages if not blacklisted_packages: print('No blacklisted packages.') return ...
[ "Uninstalls", "all", "blacklisted", "packages", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/packager.py#L389-L403
[ "def", "uninstall_blacklisted", "(", "self", ")", ":", "from", "burlap", ".", "system", "import", "distrib_family", "blacklisted_packages", "=", "self", ".", "env", ".", "blacklisted_packages", "if", "not", "blacklisted_packages", ":", "print", "(", "'No blacklisted...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
CronSatchel.deploy
Writes entire crontab to the host.
burlap/cron.py
def deploy(self, site=None): """ Writes entire crontab to the host. """ r = self.local_renderer self.deploy_logrotate() cron_crontabs = [] # if self.verbose: # print('hostname: "%s"' % (hostname,), file=sys.stderr) for _site, site_data in sel...
def deploy(self, site=None): """ Writes entire crontab to the host. """ r = self.local_renderer self.deploy_logrotate() cron_crontabs = [] # if self.verbose: # print('hostname: "%s"' % (hostname,), file=sys.stderr) for _site, site_data in sel...
[ "Writes", "entire", "crontab", "to", "the", "host", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/cron.py#L86-L127
[ "def", "deploy", "(", "self", ",", "site", "=", "None", ")", ":", "r", "=", "self", ".", "local_renderer", "self", ".", "deploy_logrotate", "(", ")", "cron_crontabs", "=", "[", "]", "# if self.verbose:", "# print('hostname: \"%s\"' % (hostname,),...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
MongoDBSatchel.load
Restores a database snapshot onto the target database server. If prep_only=1, commands for preparing the load will be generated, but not the command to finally load the snapshot.
burlap/mongodb.py
def load(self, dump_fn='', prep_only=0, force_upload=0, from_local=0, name=None, site=None, dest_dir=None): """ Restores a database snapshot onto the target database server. If prep_only=1, commands for preparing the load will be generated, but not the command to finally load the snapsh...
def load(self, dump_fn='', prep_only=0, force_upload=0, from_local=0, name=None, site=None, dest_dir=None): """ Restores a database snapshot onto the target database server. If prep_only=1, commands for preparing the load will be generated, but not the command to finally load the snapsh...
[ "Restores", "a", "database", "snapshot", "onto", "the", "target", "database", "server", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/mongodb.py#L108-L147
[ "def", "load", "(", "self", ",", "dump_fn", "=", "''", ",", "prep_only", "=", "0", ",", "force_upload", "=", "0", ",", "from_local", "=", "0", ",", "name", "=", "None", ",", "site", "=", "None", ",", "dest_dir", "=", "None", ")", ":", "r", "=", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
MongoDBSatchel.shell
Opens a SQL shell to the given database, assuming the configured database and user supports this feature.
burlap/mongodb.py
def shell(self, name='default', user=None, password=None, root=0, verbose=1, write_password=1, no_db=0, no_pw=0): """ Opens a SQL shell to the given database, assuming the configured database and user supports this feature. """ raise NotImplementedError
def shell(self, name='default', user=None, password=None, root=0, verbose=1, write_password=1, no_db=0, no_pw=0): """ Opens a SQL shell to the given database, assuming the configured database and user supports this feature. """ raise NotImplementedError
[ "Opens", "a", "SQL", "shell", "to", "the", "given", "database", "assuming", "the", "configured", "database", "and", "user", "supports", "this", "feature", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/mongodb.py#L150-L155
[ "def", "shell", "(", "self", ",", "name", "=", "'default'", ",", "user", "=", "None", ",", "password", "=", "None", ",", "root", "=", "0", ",", "verbose", "=", "1", ",", "write_password", "=", "1", ",", "no_db", "=", "0", ",", "no_pw", "=", "0", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ProjectSatchel.update_settings
Writes a key/value pair to a settings file.
burlap/project.py
def update_settings(self, d, role, path='roles/{role}/settings.yaml'): """ Writes a key/value pair to a settings file. """ try: import ruamel.yaml load_func = ruamel.yaml.round_trip_load dump_func = ruamel.yaml.round_trip_dump except ImportErro...
def update_settings(self, d, role, path='roles/{role}/settings.yaml'): """ Writes a key/value pair to a settings file. """ try: import ruamel.yaml load_func = ruamel.yaml.round_trip_load dump_func = ruamel.yaml.round_trip_dump except ImportErro...
[ "Writes", "a", "key", "/", "value", "pair", "to", "a", "settings", "file", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/project.py#L164-L181
[ "def", "update_settings", "(", "self", ",", "d", ",", "role", ",", "path", "=", "'roles/{role}/settings.yaml'", ")", ":", "try", ":", "import", "ruamel", ".", "yaml", "load_func", "=", "ruamel", ".", "yaml", ".", "round_trip_load", "dump_func", "=", "ruamel"...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
RabbitMQSatchel.configure_bleeding
Enables the repository for a most current version on Debian systems. https://www.rabbitmq.com/install-debian.html
burlap/rabbitmq.py
def configure_bleeding(self): """ Enables the repository for a most current version on Debian systems. https://www.rabbitmq.com/install-debian.html """ lm = self.last_manifest r = self.local_renderer if self.env.bleeding and not lm.bleeding: # Ins...
def configure_bleeding(self): """ Enables the repository for a most current version on Debian systems. https://www.rabbitmq.com/install-debian.html """ lm = self.last_manifest r = self.local_renderer if self.env.bleeding and not lm.bleeding: # Ins...
[ "Enables", "the", "repository", "for", "a", "most", "current", "version", "on", "Debian", "systems", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/rabbitmq.py#L103-L123
[ "def", "configure_bleeding", "(", "self", ")", ":", "lm", "=", "self", ".", "last_manifest", "r", "=", "self", ".", "local_renderer", "if", "self", ".", "env", ".", "bleeding", "and", "not", "lm", ".", "bleeding", ":", "# Install.", "r", ".", "append", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
RabbitMQSatchel.force_stop_and_purge
Forcibly kills Rabbit and purges all its queues. For emergency use when the server becomes unresponsive, even to service stop calls. If this also fails to correct the performance issues, the server may have to be completely reinstalled.
burlap/rabbitmq.py
def force_stop_and_purge(self): """ Forcibly kills Rabbit and purges all its queues. For emergency use when the server becomes unresponsive, even to service stop calls. If this also fails to correct the performance issues, the server may have to be completely reinstalled. ...
def force_stop_and_purge(self): """ Forcibly kills Rabbit and purges all its queues. For emergency use when the server becomes unresponsive, even to service stop calls. If this also fails to correct the performance issues, the server may have to be completely reinstalled. ...
[ "Forcibly", "kills", "Rabbit", "and", "purges", "all", "its", "queues", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/rabbitmq.py#L157-L173
[ "def", "force_stop_and_purge", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "self", ".", "stop", "(", ")", "with", "settings", "(", "warn_only", "=", "True", ")", ":", "r", ".", "sudo", "(", "'killall rabbitmq-server'", ")", "with", "s...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
RabbitMQSatchel._configure_users
Installs and configures RabbitMQ.
burlap/rabbitmq.py
def _configure_users(self, site=None, full=0, only_data=0): """ Installs and configures RabbitMQ. """ site = site or ALL full = int(full) if full and not only_data: packager = self.get_satchel('packager') packager.install_required(type=SYSTEM, s...
def _configure_users(self, site=None, full=0, only_data=0): """ Installs and configures RabbitMQ. """ site = site or ALL full = int(full) if full and not only_data: packager = self.get_satchel('packager') packager.install_required(type=SYSTEM, s...
[ "Installs", "and", "configures", "RabbitMQ", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/rabbitmq.py#L281-L313
[ "def", "_configure_users", "(", "self", ",", "site", "=", "None", ",", "full", "=", "0", ",", "only_data", "=", "0", ")", ":", "site", "=", "site", "or", "ALL", "full", "=", "int", "(", "full", ")", "if", "full", "and", "not", "only_data", ":", "...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
RabbitMQSatchel.record_manifest
Returns a dictionary representing a serialized state of the service.
burlap/rabbitmq.py
def record_manifest(self): """ Returns a dictionary representing a serialized state of the service. """ data = super(RabbitMQSatchel, self).record_manifest() params = sorted(list(self.get_user_vhosts())) # [(user, password, vhost)] data['rabbitmq_all_site_vhosts'] = param...
def record_manifest(self): """ Returns a dictionary representing a serialized state of the service. """ data = super(RabbitMQSatchel, self).record_manifest() params = sorted(list(self.get_user_vhosts())) # [(user, password, vhost)] data['rabbitmq_all_site_vhosts'] = param...
[ "Returns", "a", "dictionary", "representing", "a", "serialized", "state", "of", "the", "service", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/rabbitmq.py#L315-L323
[ "def", "record_manifest", "(", "self", ")", ":", "data", "=", "super", "(", "RabbitMQSatchel", ",", "self", ")", ".", "record_manifest", "(", ")", "params", "=", "sorted", "(", "list", "(", "self", ".", "get_user_vhosts", "(", ")", ")", ")", "# [(user, p...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
iter_dict_differences
Returns a generator yielding all the keys that have values that differ between each dictionary.
burlap/deploy.py
def iter_dict_differences(a, b): """ Returns a generator yielding all the keys that have values that differ between each dictionary. """ common_keys = set(a).union(b) for k in common_keys: a_value = a.get(k) b_value = b.get(k) if a_value != b_value: yield k, (a_va...
def iter_dict_differences(a, b): """ Returns a generator yielding all the keys that have values that differ between each dictionary. """ common_keys = set(a).union(b) for k in common_keys: a_value = a.get(k) b_value = b.get(k) if a_value != b_value: yield k, (a_va...
[ "Returns", "a", "generator", "yielding", "all", "the", "keys", "that", "have", "values", "that", "differ", "between", "each", "dictionary", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/deploy.py#L21-L30
[ "def", "iter_dict_differences", "(", "a", ",", "b", ")", ":", "common_keys", "=", "set", "(", "a", ")", ".", "union", "(", "b", ")", "for", "k", "in", "common_keys", ":", "a_value", "=", "a", ".", "get", "(", "k", ")", "b_value", "=", "b", ".", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
get_component_order
Given a list of components, re-orders them according to inter-component dependencies so the most depended upon are first.
burlap/deploy.py
def get_component_order(component_names): """ Given a list of components, re-orders them according to inter-component dependencies so the most depended upon are first. """ assert isinstance(component_names, (tuple, list)) component_dependences = {} for _name in component_names: deps = se...
def get_component_order(component_names): """ Given a list of components, re-orders them according to inter-component dependencies so the most depended upon are first. """ assert isinstance(component_names, (tuple, list)) component_dependences = {} for _name in component_names: deps = se...
[ "Given", "a", "list", "of", "components", "re", "-", "orders", "them", "according", "to", "inter", "-", "component", "dependencies", "so", "the", "most", "depended", "upon", "are", "first", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/deploy.py#L32-L43
[ "def", "get_component_order", "(", "component_names", ")", ":", "assert", "isinstance", "(", "component_names", ",", "(", "tuple", ",", "list", ")", ")", "component_dependences", "=", "{", "}", "for", "_name", "in", "component_names", ":", "deps", "=", "set", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
get_deploy_funcs
Returns a generator yielding the named functions needed for a deployment.
burlap/deploy.py
def get_deploy_funcs(components, current_thumbprint, previous_thumbprint, preview=False): """ Returns a generator yielding the named functions needed for a deployment. """ for component in components: funcs = manifest_deployers.get(component, []) for func_name in funcs: #TOD...
def get_deploy_funcs(components, current_thumbprint, previous_thumbprint, preview=False): """ Returns a generator yielding the named functions needed for a deployment. """ for component in components: funcs = manifest_deployers.get(component, []) for func_name in funcs: #TOD...
[ "Returns", "a", "generator", "yielding", "the", "named", "functions", "needed", "for", "a", "deployment", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/deploy.py#L45-L66
[ "def", "get_deploy_funcs", "(", "components", ",", "current_thumbprint", ",", "previous_thumbprint", ",", "preview", "=", "False", ")", ":", "for", "component", "in", "components", ":", "funcs", "=", "manifest_deployers", ".", "get", "(", "component", ",", "[", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DeploySatchel.manifest_filename
Returns the path to the manifest file.
burlap/deploy.py
def manifest_filename(self): """ Returns the path to the manifest file. """ r = self.local_renderer tp_fn = r.format(r.env.data_dir + '/manifest.yaml') return tp_fn
def manifest_filename(self): """ Returns the path to the manifest file. """ r = self.local_renderer tp_fn = r.format(r.env.data_dir + '/manifest.yaml') return tp_fn
[ "Returns", "the", "path", "to", "the", "manifest", "file", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/deploy.py#L95-L101
[ "def", "manifest_filename", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "tp_fn", "=", "r", ".", "format", "(", "r", ".", "env", ".", "data_dir", "+", "'/manifest.yaml'", ")", "return", "tp_fn" ]
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DeploySatchel.get_current_thumbprint
Returns a dictionary representing the current configuration state. Thumbprint is of the form: { component_name1: {key: value}, component_name2: {key: value}, ... }
burlap/deploy.py
def get_current_thumbprint(self, components=None): """ Returns a dictionary representing the current configuration state. Thumbprint is of the form: { component_name1: {key: value}, component_name2: {key: value}, ... } ...
def get_current_thumbprint(self, components=None): """ Returns a dictionary representing the current configuration state. Thumbprint is of the form: { component_name1: {key: value}, component_name2: {key: value}, ... } ...
[ "Returns", "a", "dictionary", "representing", "the", "current", "configuration", "state", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/deploy.py#L103-L137
[ "def", "get_current_thumbprint", "(", "self", ",", "components", "=", "None", ")", ":", "components", "=", "str_to_component_list", "(", "components", ")", "if", "self", ".", "verbose", ":", "print", "(", "'deploy.get_current_thumbprint.components:'", ",", "componen...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DeploySatchel.get_previous_thumbprint
Returns a dictionary representing the previous configuration state. Thumbprint is of the form: { component_name1: {key: value}, component_name2: {key: value}, ... }
burlap/deploy.py
def get_previous_thumbprint(self, components=None): """ Returns a dictionary representing the previous configuration state. Thumbprint is of the form: { component_name1: {key: value}, component_name2: {key: value}, ... } ...
def get_previous_thumbprint(self, components=None): """ Returns a dictionary representing the previous configuration state. Thumbprint is of the form: { component_name1: {key: value}, component_name2: {key: value}, ... } ...
[ "Returns", "a", "dictionary", "representing", "the", "previous", "configuration", "state", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/deploy.py#L139-L167
[ "def", "get_previous_thumbprint", "(", "self", ",", "components", "=", "None", ")", ":", "components", "=", "str_to_component_list", "(", "components", ")", "tp_fn", "=", "self", ".", "manifest_filename", "tp_text", "=", "None", "if", "self", ".", "file_exists",...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DeploySatchel.lock
Marks the remote server as currently being deployed to.
burlap/deploy.py
def lock(self): """ Marks the remote server as currently being deployed to. """ self.init() r = self.local_renderer if self.file_exists(r.env.lockfile_path): raise exceptions.AbortDeployment('Lock file %s exists. Perhaps another deployment is currently underwa...
def lock(self): """ Marks the remote server as currently being deployed to. """ self.init() r = self.local_renderer if self.file_exists(r.env.lockfile_path): raise exceptions.AbortDeployment('Lock file %s exists. Perhaps another deployment is currently underwa...
[ "Marks", "the", "remote", "server", "as", "currently", "being", "deployed", "to", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/deploy.py#L170-L181
[ "def", "lock", "(", "self", ")", ":", "self", ".", "init", "(", ")", "r", "=", "self", ".", "local_renderer", "if", "self", ".", "file_exists", "(", "r", ".", "env", ".", "lockfile_path", ")", ":", "raise", "exceptions", ".", "AbortDeployment", "(", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DeploySatchel.unlock
Unmarks the remote server as currently being deployed to.
burlap/deploy.py
def unlock(self): """ Unmarks the remote server as currently being deployed to. """ self.init() r = self.local_renderer if self.file_exists(r.env.lockfile_path): self.vprint('Unlocking %s.' % r.env.lockfile_path) r.run_or_local('rm -f {lockfile_pat...
def unlock(self): """ Unmarks the remote server as currently being deployed to. """ self.init() r = self.local_renderer if self.file_exists(r.env.lockfile_path): self.vprint('Unlocking %s.' % r.env.lockfile_path) r.run_or_local('rm -f {lockfile_pat...
[ "Unmarks", "the", "remote", "server", "as", "currently", "being", "deployed", "to", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/deploy.py#L184-L192
[ "def", "unlock", "(", "self", ")", ":", "self", ".", "init", "(", ")", "r", "=", "self", ".", "local_renderer", "if", "self", ".", "file_exists", "(", "r", ".", "env", ".", "lockfile_path", ")", ":", "self", ".", "vprint", "(", "'Unlocking %s.'", "%"...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DeploySatchel.fake
Update the thumbprint on the remote server but execute no satchel configurators. components = A comma-delimited list of satchel names to limit the fake deployment to. set_satchels = A semi-colon delimited list of key-value pairs to set in satchels before recording a fake deployment.
burlap/deploy.py
def fake(self, components=None):#, set_satchels=None): """ Update the thumbprint on the remote server but execute no satchel configurators. components = A comma-delimited list of satchel names to limit the fake deployment to. set_satchels = A semi-colon delimited list of key-value pairs...
def fake(self, components=None):#, set_satchels=None): """ Update the thumbprint on the remote server but execute no satchel configurators. components = A comma-delimited list of satchel names to limit the fake deployment to. set_satchels = A semi-colon delimited list of key-value pairs...
[ "Update", "the", "thumbprint", "on", "the", "remote", "server", "but", "execute", "no", "satchel", "configurators", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/deploy.py#L195-L218
[ "def", "fake", "(", "self", ",", "components", "=", "None", ")", ":", "#, set_satchels=None):", "self", ".", "init", "(", ")", "# In cases where we only want to fake deployment of a specific satchel, then simply copy the last thumbprint and overwrite with a subset", "# of the curre...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DeploySatchel.get_component_funcs
Calculates the components functions that need to be executed for a deployment.
burlap/deploy.py
def get_component_funcs(self, components=None): """ Calculates the components functions that need to be executed for a deployment. """ current_tp = self.get_current_thumbprint(components=components) or {} previous_tp = self.get_previous_thumbprint(components=components) or {} ...
def get_component_funcs(self, components=None): """ Calculates the components functions that need to be executed for a deployment. """ current_tp = self.get_current_thumbprint(components=components) or {} previous_tp = self.get_previous_thumbprint(components=components) or {} ...
[ "Calculates", "the", "components", "functions", "that", "need", "to", "be", "executed", "for", "a", "deployment", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/deploy.py#L220-L244
[ "def", "get_component_funcs", "(", "self", ",", "components", "=", "None", ")", ":", "current_tp", "=", "self", ".", "get_current_thumbprint", "(", "components", "=", "components", ")", "or", "{", "}", "previous_tp", "=", "self", ".", "get_previous_thumbprint", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DeploySatchel.preview
Inspects differences between the last deployment and the current code state.
burlap/deploy.py
def preview(self, components=None, ask=0): """ Inspects differences between the last deployment and the current code state. """ ask = int(ask) self.init() component_order, plan_funcs = self.get_component_funcs(components=components) print('\n%i changes found f...
def preview(self, components=None, ask=0): """ Inspects differences between the last deployment and the current code state. """ ask = int(ask) self.init() component_order, plan_funcs = self.get_component_funcs(components=components) print('\n%i changes found f...
[ "Inspects", "differences", "between", "the", "last", "deployment", "and", "the", "current", "code", "state", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/deploy.py#L247-L275
[ "def", "preview", "(", "self", ",", "components", "=", "None", ",", "ask", "=", "0", ")", ":", "ask", "=", "int", "(", "ask", ")", "self", ".", "init", "(", ")", "component_order", ",", "plan_funcs", "=", "self", ".", "get_component_funcs", "(", "com...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DeploySatchel.push
Executes all satchel configurators to apply pending changes to the server.
burlap/deploy.py
def push(self, components=None, yes=0): """ Executes all satchel configurators to apply pending changes to the server. """ from burlap import notifier service = self.get_satchel('service') self.lock() try: yes = int(yes) if not yes: ...
def push(self, components=None, yes=0): """ Executes all satchel configurators to apply pending changes to the server. """ from burlap import notifier service = self.get_satchel('service') self.lock() try: yes = int(yes) if not yes: ...
[ "Executes", "all", "satchel", "configurators", "to", "apply", "pending", "changes", "to", "the", "server", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/deploy.py#L278-L307
[ "def", "push", "(", "self", ",", "components", "=", "None", ",", "yes", "=", "0", ")", ":", "from", "burlap", "import", "notifier", "service", "=", "self", ".", "get_satchel", "(", "'service'", ")", "self", ".", "lock", "(", ")", "try", ":", "yes", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DjangoSettingsTracker.get_thumbprint
Calculates the current thumbprint of the item being tracked.
burlap/dj.py
def get_thumbprint(self): """ Calculates the current thumbprint of the item being tracked. """ d = {} settings = dj.get_settings() for name in self.names: d[name] = getattr(settings, name) return d
def get_thumbprint(self): """ Calculates the current thumbprint of the item being tracked. """ d = {} settings = dj.get_settings() for name in self.names: d[name] = getattr(settings, name) return d
[ "Calculates", "the", "current", "thumbprint", "of", "the", "item", "being", "tracked", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/dj.py#L54-L62
[ "def", "get_thumbprint", "(", "self", ")", ":", "d", "=", "{", "}", "settings", "=", "dj", ".", "get_settings", "(", ")", "for", "name", "in", "self", ".", "names", ":", "d", "[", "name", "]", "=", "getattr", "(", "settings", ",", "name", ")", "r...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DjangoSatchel.get_settings
Retrieves the Django settings dictionary.
burlap/dj.py
def get_settings(self, site=None, role=None): """ Retrieves the Django settings dictionary. """ r = self.local_renderer _stdout = sys.stdout _stderr = sys.stderr if not self.verbose: sys.stdout = StringIO() sys.stderr = StringIO() t...
def get_settings(self, site=None, role=None): """ Retrieves the Django settings dictionary. """ r = self.local_renderer _stdout = sys.stdout _stderr = sys.stderr if not self.verbose: sys.stdout = StringIO() sys.stderr = StringIO() t...
[ "Retrieves", "the", "Django", "settings", "dictionary", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/dj.py#L142-L221
[ "def", "get_settings", "(", "self", ",", "site", "=", "None", ",", "role", "=", "None", ")", ":", "r", "=", "self", ".", "local_renderer", "_stdout", "=", "sys", ".", "stdout", "_stderr", "=", "sys", ".", "stderr", "if", "not", "self", ".", "verbose"...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DjangoSatchel.install_sql
Installs all custom SQL.
burlap/dj.py
def install_sql(self, site=None, database='default', apps=None, stop_on_error=0, fn=None): """ Installs all custom SQL. """ #from burlap.db import load_db_set stop_on_error = int(stop_on_error) site = site or ALL name = database r = self.local_renderer...
def install_sql(self, site=None, database='default', apps=None, stop_on_error=0, fn=None): """ Installs all custom SQL. """ #from burlap.db import load_db_set stop_on_error = int(stop_on_error) site = site or ALL name = database r = self.local_renderer...
[ "Installs", "all", "custom", "SQL", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/dj.py#L258-L365
[ "def", "install_sql", "(", "self", ",", "site", "=", "None", ",", "database", "=", "'default'", ",", "apps", "=", "None", ",", "stop_on_error", "=", "0", ",", "fn", "=", "None", ")", ":", "#from burlap.db import load_db_set", "stop_on_error", "=", "int", "...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DjangoSatchel.createsuperuser
Runs the Django createsuperuser management command.
burlap/dj.py
def createsuperuser(self, username='admin', email=None, password=None, site=None): """ Runs the Django createsuperuser management command. """ r = self.local_renderer site = site or self.genv.SITE self.set_site_specifics(site) options = ['--username=%s' % username...
def createsuperuser(self, username='admin', email=None, password=None, site=None): """ Runs the Django createsuperuser management command. """ r = self.local_renderer site = site or self.genv.SITE self.set_site_specifics(site) options = ['--username=%s' % username...
[ "Runs", "the", "Django", "createsuperuser", "management", "command", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/dj.py#L368-L384
[ "def", "createsuperuser", "(", "self", ",", "username", "=", "'admin'", ",", "email", "=", "None", ",", "password", "=", "None", ",", "site", "=", "None", ")", ":", "r", "=", "self", ".", "local_renderer", "site", "=", "site", "or", "self", ".", "gen...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DjangoSatchel.loaddata
Runs the Dango loaddata management command. By default, runs on only the current site. Pass site=all to run on all sites.
burlap/dj.py
def loaddata(self, path, site=None): """ Runs the Dango loaddata management command. By default, runs on only the current site. Pass site=all to run on all sites. """ site = site or self.genv.SITE r = self.local_renderer r.env._loaddata_path = path ...
def loaddata(self, path, site=None): """ Runs the Dango loaddata management command. By default, runs on only the current site. Pass site=all to run on all sites. """ site = site or self.genv.SITE r = self.local_renderer r.env._loaddata_path = path ...
[ "Runs", "the", "Dango", "loaddata", "management", "command", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/dj.py#L387-L406
[ "def", "loaddata", "(", "self", ",", "path", ",", "site", "=", "None", ")", ":", "site", "=", "site", "or", "self", ".", "genv", ".", "SITE", "r", "=", "self", ".", "local_renderer", "r", ".", "env", ".", "_loaddata_path", "=", "path", "for", "_sit...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DjangoSatchel.manage
A generic wrapper around Django's manage command.
burlap/dj.py
def manage(self, cmd, *args, **kwargs): """ A generic wrapper around Django's manage command. """ r = self.local_renderer environs = kwargs.pop('environs', '').strip() if environs: environs = ' '.join('export %s=%s;' % tuple(_.split('=')) for _ in environs.spl...
def manage(self, cmd, *args, **kwargs): """ A generic wrapper around Django's manage command. """ r = self.local_renderer environs = kwargs.pop('environs', '').strip() if environs: environs = ' '.join('export %s=%s;' % tuple(_.split('=')) for _ in environs.spl...
[ "A", "generic", "wrapper", "around", "Django", "s", "manage", "command", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/dj.py#L409-L427
[ "def", "manage", "(", "self", ",", "cmd", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "r", "=", "self", ".", "local_renderer", "environs", "=", "kwargs", ".", "pop", "(", "'environs'", ",", "''", ")", ".", "strip", "(", ")", "if", "envir...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DjangoSatchel.manage_all
Runs manage() across all unique site default databases.
burlap/dj.py
def manage_all(self, *args, **kwargs): """ Runs manage() across all unique site default databases. """ for site, site_data in self.iter_unique_databases(site='all'): if self.verbose: print('-'*80, file=sys.stderr) print('site:', site, file=sys....
def manage_all(self, *args, **kwargs): """ Runs manage() across all unique site default databases. """ for site, site_data in self.iter_unique_databases(site='all'): if self.verbose: print('-'*80, file=sys.stderr) print('site:', site, file=sys....
[ "Runs", "manage", "()", "across", "all", "unique", "site", "default", "databases", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/dj.py#L430-L444
[ "def", "manage_all", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "for", "site", ",", "site_data", "in", "self", ".", "iter_unique_databases", "(", "site", "=", "'all'", ")", ":", "if", "self", ".", "verbose", ":", "print", "(", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DjangoSatchel.load_django_settings
Loads Django settings for the current site and sets them so Django internals can be run.
burlap/dj.py
def load_django_settings(self): """ Loads Django settings for the current site and sets them so Django internals can be run. """ r = self.local_renderer # Save environment variables so we can restore them later. _env = {} save_vars = ['ALLOW_CELERY', 'DJANGO_SETT...
def load_django_settings(self): """ Loads Django settings for the current site and sets them so Django internals can be run. """ r = self.local_renderer # Save environment variables so we can restore them later. _env = {} save_vars = ['ALLOW_CELERY', 'DJANGO_SETT...
[ "Loads", "Django", "settings", "for", "the", "current", "site", "and", "sets", "them", "so", "Django", "internals", "can", "be", "run", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/dj.py#L446-L517
[ "def", "load_django_settings", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "# Save environment variables so we can restore them later.", "_env", "=", "{", "}", "save_vars", "=", "[", "'ALLOW_CELERY'", ",", "'DJANGO_SETTINGS_MODULE'", "]", "for", "v...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DjangoSatchel.shell
Opens a Django focussed Python shell. Essentially the equivalent of running `manage.py shell`.
burlap/dj.py
def shell(self): """ Opens a Django focussed Python shell. Essentially the equivalent of running `manage.py shell`. """ r = self.local_renderer if '@' in self.genv.host_string: r.env.shell_host_string = self.genv.host_string else: r.env.she...
def shell(self): """ Opens a Django focussed Python shell. Essentially the equivalent of running `manage.py shell`. """ r = self.local_renderer if '@' in self.genv.host_string: r.env.shell_host_string = self.genv.host_string else: r.env.she...
[ "Opens", "a", "Django", "focussed", "Python", "shell", ".", "Essentially", "the", "equivalent", "of", "running", "manage", ".", "py", "shell", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/dj.py#L579-L591
[ "def", "shell", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "if", "'@'", "in", "self", ".", "genv", ".", "host_string", ":", "r", ".", "env", ".", "shell_host_string", "=", "self", ".", "genv", ".", "host_string", "else", ":", "r"...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DjangoSatchel.syncdb
Runs the standard Django syncdb command for one or more sites.
burlap/dj.py
def syncdb(self, site=None, all=0, database=None, ignore_errors=1): # pylint: disable=redefined-builtin """ Runs the standard Django syncdb command for one or more sites. """ r = self.local_renderer ignore_errors = int(ignore_errors) post_south = self.version_tuple >= (...
def syncdb(self, site=None, all=0, database=None, ignore_errors=1): # pylint: disable=redefined-builtin """ Runs the standard Django syncdb command for one or more sites. """ r = self.local_renderer ignore_errors = int(ignore_errors) post_south = self.version_tuple >= (...
[ "Runs", "the", "standard", "Django", "syncdb", "command", "for", "one", "or", "more", "sites", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/dj.py#L594-L633
[ "def", "syncdb", "(", "self", ",", "site", "=", "None", ",", "all", "=", "0", ",", "database", "=", "None", ",", "ignore_errors", "=", "1", ")", ":", "# pylint: disable=redefined-builtin", "r", "=", "self", ".", "local_renderer", "ignore_errors", "=", "int...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DjangoSatchel.migrate
Runs the standard South migrate command for one or more sites.
burlap/dj.py
def migrate(self, app='', migration='', site=None, fake=0, ignore_errors=None, skip_databases=None, database=None, migrate_apps='', delete_ghosts=1): """ Runs the standard South migrate command for one or more sites. """ # Note, to pass a comma-delimted list in a fab command, escape the ...
def migrate(self, app='', migration='', site=None, fake=0, ignore_errors=None, skip_databases=None, database=None, migrate_apps='', delete_ghosts=1): """ Runs the standard South migrate command for one or more sites. """ # Note, to pass a comma-delimted list in a fab command, escape the ...
[ "Runs", "the", "standard", "South", "migrate", "command", "for", "one", "or", "more", "sites", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/dj.py#L641-L717
[ "def", "migrate", "(", "self", ",", "app", "=", "''", ",", "migration", "=", "''", ",", "site", "=", "None", ",", "fake", "=", "0", ",", "ignore_errors", "=", "None", ",", "skip_databases", "=", "None", ",", "database", "=", "None", ",", "migrate_app...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DjangoSatchel.manage_async
Starts a Django management command in a screen. Parameters: command :- all arguments passed to `./manage` as a single string site :- the site to run the command for (default is all) Designed to be ran like: fab <role> dj.manage_async:"some_management_command --fo...
burlap/dj.py
def manage_async(self, command='', name='process', site=ALL, exclude_sites='', end_message='', recipients=''): """ Starts a Django management command in a screen. Parameters: command :- all arguments passed to `./manage` as a single string site :- the site to run the c...
def manage_async(self, command='', name='process', site=ALL, exclude_sites='', end_message='', recipients=''): """ Starts a Django management command in a screen. Parameters: command :- all arguments passed to `./manage` as a single string site :- the site to run the c...
[ "Starts", "a", "Django", "management", "command", "in", "a", "screen", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/dj.py#L736-L770
[ "def", "manage_async", "(", "self", ",", "command", "=", "''", ",", "name", "=", "'process'", ",", "site", "=", "ALL", ",", "exclude_sites", "=", "''", ",", "end_message", "=", "''", ",", "recipients", "=", "''", ")", ":", "exclude_sites", "=", "exclud...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DjangoSatchel.get_media_timestamp
Retrieves the most recent timestamp of the media in the static root. If last_timestamp is given, retrieves the first timestamp more recent than this value.
burlap/dj.py
def get_media_timestamp(self, last_timestamp=None): """ Retrieves the most recent timestamp of the media in the static root. If last_timestamp is given, retrieves the first timestamp more recent than this value. """ r = self.local_renderer _latest_timestamp = -1e99999999...
def get_media_timestamp(self, last_timestamp=None): """ Retrieves the most recent timestamp of the media in the static root. If last_timestamp is given, retrieves the first timestamp more recent than this value. """ r = self.local_renderer _latest_timestamp = -1e99999999...
[ "Retrieves", "the", "most", "recent", "timestamp", "of", "the", "media", "in", "the", "static", "root", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/dj.py#L773-L791
[ "def", "get_media_timestamp", "(", "self", ",", "last_timestamp", "=", "None", ")", ":", "r", "=", "self", ".", "local_renderer", "_latest_timestamp", "=", "-", "1e9999999999999999", "for", "path", "in", "self", ".", "iter_static_paths", "(", ")", ":", "path",...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DatabaseSatchel.set_root_login
Looks up the root login for the given database on the given host and sets it to environment variables. Populates these standard variables: db_root_password db_root_username
burlap/db.py
def set_root_login(self, r): """ Looks up the root login for the given database on the given host and sets it to environment variables. Populates these standard variables: db_root_password db_root_username """ # Check the legacy password locati...
def set_root_login(self, r): """ Looks up the root login for the given database on the given host and sets it to environment variables. Populates these standard variables: db_root_password db_root_username """ # Check the legacy password locati...
[ "Looks", "up", "the", "root", "login", "for", "the", "given", "database", "on", "the", "given", "host", "and", "sets", "it", "to", "environment", "variables", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/db.py#L79-L117
[ "def", "set_root_login", "(", "self", ",", "r", ")", ":", "# Check the legacy password location.", "try", ":", "r", ".", "env", ".", "db_root_username", "=", "r", ".", "env", ".", "root_username", "except", "AttributeError", ":", "pass", "try", ":", "r", "."...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DatabaseSatchel.database_renderer
Renders local settings for a specific database.
burlap/db.py
def database_renderer(self, name=None, site=None, role=None): """ Renders local settings for a specific database. """ name = name or self.env.default_db_name site = site or self.genv.SITE role = role or self.genv.ROLE key = (name, site, role) self.vpri...
def database_renderer(self, name=None, site=None, role=None): """ Renders local settings for a specific database. """ name = name or self.env.default_db_name site = site or self.genv.SITE role = role or self.genv.ROLE key = (name, site, role) self.vpri...
[ "Renders", "local", "settings", "for", "a", "specific", "database", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/db.py#L120-L188
[ "def", "database_renderer", "(", "self", ",", "name", "=", "None", ",", "site", "=", "None", ",", "role", "=", "None", ")", ":", "name", "=", "name", "or", "self", ".", "env", ".", "default_db_name", "site", "=", "site", "or", "self", ".", "genv", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DatabaseSatchel.get_free_space
Return free space in bytes.
burlap/db.py
def get_free_space(self): """ Return free space in bytes. """ cmd = "df -k | grep -vE '^Filesystem|tmpfs|cdrom|none|udev|cgroup' | awk '{ print($1 \" \" $4 }'" lines = [_ for _ in self.run(cmd).strip().split('\n') if _.startswith('/')] assert len(lines) == 1, 'Ambiguous d...
def get_free_space(self): """ Return free space in bytes. """ cmd = "df -k | grep -vE '^Filesystem|tmpfs|cdrom|none|udev|cgroup' | awk '{ print($1 \" \" $4 }'" lines = [_ for _ in self.run(cmd).strip().split('\n') if _.startswith('/')] assert len(lines) == 1, 'Ambiguous d...
[ "Return", "free", "space", "in", "bytes", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/db.py#L195-L205
[ "def", "get_free_space", "(", "self", ")", ":", "cmd", "=", "\"df -k | grep -vE '^Filesystem|tmpfs|cdrom|none|udev|cgroup' | awk '{ print($1 \\\" \\\" $4 }'\"", "lines", "=", "[", "_", "for", "_", "in", "self", ".", "run", "(", "cmd", ")", ".", "strip", "(", ")", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DatabaseSatchel.load_db_set
Loads database parameters from a specific named set.
burlap/db.py
def load_db_set(self, name, r=None): """ Loads database parameters from a specific named set. """ r = r or self db_set = r.genv.db_sets.get(name, {}) r.genv.update(db_set)
def load_db_set(self, name, r=None): """ Loads database parameters from a specific named set. """ r = r or self db_set = r.genv.db_sets.get(name, {}) r.genv.update(db_set)
[ "Loads", "database", "parameters", "from", "a", "specific", "named", "set", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/db.py#L233-L239
[ "def", "load_db_set", "(", "self", ",", "name", ",", "r", "=", "None", ")", ":", "r", "=", "r", "or", "self", "db_set", "=", "r", ".", "genv", ".", "db_sets", ".", "get", "(", "name", ",", "{", "}", ")", "r", ".", "genv", ".", "update", "(", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DatabaseSatchel.loadable
Determines if there's enough space to load the target database.
burlap/db.py
def loadable(self, src, dst): """ Determines if there's enough space to load the target database. """ from fabric import state from fabric.task_utils import crawl src_task = crawl(src, state.commands) assert src_task, 'Unknown source role: %s' % src dst_...
def loadable(self, src, dst): """ Determines if there's enough space to load the target database. """ from fabric import state from fabric.task_utils import crawl src_task = crawl(src, state.commands) assert src_task, 'Unknown source role: %s' % src dst_...
[ "Determines", "if", "there", "s", "enough", "space", "to", "load", "the", "target", "database", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/db.py#L242-L286
[ "def", "loadable", "(", "self", ",", "src", ",", "dst", ")", ":", "from", "fabric", "import", "state", "from", "fabric", ".", "task_utils", "import", "crawl", "src_task", "=", "crawl", "(", "src", ",", "state", ".", "commands", ")", "assert", "src_task",...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
DatabaseSatchel.dump
Exports the target database to a single transportable file on the localhost, appropriate for loading using load().
burlap/db.py
def dump(self, dest_dir=None, to_local=1, from_local=0, archive=0, dump_fn=None, name=None, site=None, use_sudo=0, cleanup=1): """ Exports the target database to a single transportable file on the localhost, appropriate for loading using load(). """ r = self.local_renderer ...
def dump(self, dest_dir=None, to_local=1, from_local=0, archive=0, dump_fn=None, name=None, site=None, use_sudo=0, cleanup=1): """ Exports the target database to a single transportable file on the localhost, appropriate for loading using load(). """ r = self.local_renderer ...
[ "Exports", "the", "target", "database", "to", "a", "single", "transportable", "file", "on", "the", "localhost", "appropriate", "for", "loading", "using", "load", "()", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/db.py#L321-L382
[ "def", "dump", "(", "self", ",", "dest_dir", "=", "None", ",", "to_local", "=", "1", ",", "from_local", "=", "0", ",", "archive", "=", "0", ",", "dump_fn", "=", "None", ",", "name", "=", "None", ",", "site", "=", "None", ",", "use_sudo", "=", "0"...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
show
Displays a list of all environment key/value pairs for the current role.
burlap/settings.py
def show(keyword=''): """ Displays a list of all environment key/value pairs for the current role. """ keyword = keyword.strip().lower() max_len = max(len(k) for k in env.iterkeys()) keyword_found = False for k in sorted(env.keys()): if keyword and keyword not in k.lower(): ...
def show(keyword=''): """ Displays a list of all environment key/value pairs for the current role. """ keyword = keyword.strip().lower() max_len = max(len(k) for k in env.iterkeys()) keyword_found = False for k in sorted(env.keys()): if keyword and keyword not in k.lower(): ...
[ "Displays", "a", "list", "of", "all", "environment", "key", "/", "value", "pairs", "for", "the", "current", "role", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/settings.py#L17-L33
[ "def", "show", "(", "keyword", "=", "''", ")", ":", "keyword", "=", "keyword", ".", "strip", "(", ")", ".", "lower", "(", ")", "max_len", "=", "max", "(", "len", "(", "k", ")", "for", "k", "in", "env", ".", "iterkeys", "(", ")", ")", "keyword_f...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
record_manifest
Called after a deployment to record any data necessary to detect changes for a future deployment.
burlap/settings.py
def record_manifest(): """ Called after a deployment to record any data necessary to detect changes for a future deployment. """ data = {} # Record settings. data['settings'] = dict( (k, v) for k, v in env.items() if not isinstance(v, types.GeneratorType) and k.strip(...
def record_manifest(): """ Called after a deployment to record any data necessary to detect changes for a future deployment. """ data = {} # Record settings. data['settings'] = dict( (k, v) for k, v in env.items() if not isinstance(v, types.GeneratorType) and k.strip(...
[ "Called", "after", "a", "deployment", "to", "record", "any", "data", "necessary", "to", "detect", "changes", "for", "a", "future", "deployment", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/settings.py#L37-L52
[ "def", "record_manifest", "(", ")", ":", "data", "=", "{", "}", "# Record settings.", "data", "[", "'settings'", "]", "=", "dict", "(", "(", "k", ",", "v", ")", "for", "k", ",", "v", "in", "env", ".", "items", "(", ")", "if", "not", "isinstance", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
RaspberryPiSatchel.fix_eth0_rename
A bug as of 2016.10.10 causes eth0 to be renamed to enx*. This renames it to eth0. http://raspberrypi.stackexchange.com/q/43560/29103
burlap/rpi.py
def fix_eth0_rename(self, hardware_addr): """ A bug as of 2016.10.10 causes eth0 to be renamed to enx*. This renames it to eth0. http://raspberrypi.stackexchange.com/q/43560/29103 """ r = self.local_renderer r.env.hardware_addr = hardware_addr r.sudo('ln ...
def fix_eth0_rename(self, hardware_addr): """ A bug as of 2016.10.10 causes eth0 to be renamed to enx*. This renames it to eth0. http://raspberrypi.stackexchange.com/q/43560/29103 """ r = self.local_renderer r.env.hardware_addr = hardware_addr r.sudo('ln ...
[ "A", "bug", "as", "of", "2016", ".", "10", ".", "10", "causes", "eth0", "to", "be", "renamed", "to", "enx", "*", ".", "This", "renames", "it", "to", "eth0", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/rpi.py#L101-L119
[ "def", "fix_eth0_rename", "(", "self", ",", "hardware_addr", ")", ":", "r", "=", "self", ".", "local_renderer", "r", ".", "env", ".", "hardware_addr", "=", "hardware_addr", "r", ".", "sudo", "(", "'ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules'", ")", "...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
RaspberryPiSatchel.assume_localhost
Sets connection parameters to localhost, if not set already.
burlap/rpi.py
def assume_localhost(self): """ Sets connection parameters to localhost, if not set already. """ if not self.genv.host_string: self.genv.host_string = 'localhost' self.genv.hosts = ['localhost'] self.genv.user = getpass.getuser()
def assume_localhost(self): """ Sets connection parameters to localhost, if not set already. """ if not self.genv.host_string: self.genv.host_string = 'localhost' self.genv.hosts = ['localhost'] self.genv.user = getpass.getuser()
[ "Sets", "connection", "parameters", "to", "localhost", "if", "not", "set", "already", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/rpi.py#L121-L128
[ "def", "assume_localhost", "(", "self", ")", ":", "if", "not", "self", ".", "genv", ".", "host_string", ":", "self", ".", "genv", ".", "host_string", "=", "'localhost'", "self", ".", "genv", ".", "hosts", "=", "[", "'localhost'", "]", "self", ".", "gen...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
RaspberryPiSatchel.init_raspbian_disk
Downloads the latest Raspbian image and writes it to a microSD card. Based on the instructions from: https://www.raspberrypi.org/documentation/installation/installing-images/linux.md
burlap/rpi.py
def init_raspbian_disk(self, yes=0): """ Downloads the latest Raspbian image and writes it to a microSD card. Based on the instructions from: https://www.raspberrypi.org/documentation/installation/installing-images/linux.md """ self.assume_localhost() yes = int...
def init_raspbian_disk(self, yes=0): """ Downloads the latest Raspbian image and writes it to a microSD card. Based on the instructions from: https://www.raspberrypi.org/documentation/installation/installing-images/linux.md """ self.assume_localhost() yes = int...
[ "Downloads", "the", "latest", "Raspbian", "image", "and", "writes", "it", "to", "a", "microSD", "card", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/rpi.py#L131-L167
[ "def", "init_raspbian_disk", "(", "self", ",", "yes", "=", "0", ")", ":", "self", ".", "assume_localhost", "(", ")", "yes", "=", "int", "(", "yes", ")", "device_question", "=", "'SD card present at %s? '", "%", "self", ".", "env", ".", "sd_device", "if", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
RaspberryPiSatchel.init_ubuntu_disk
Downloads the latest Ubuntu image and writes it to a microSD card. Based on the instructions from: https://wiki.ubuntu.com/ARM/RaspberryPi For recommended SD card brands, see: http://elinux.org/RPi_SD_cards Note, if you get an error like: Kernel panic-no...
burlap/rpi.py
def init_ubuntu_disk(self, yes=0): """ Downloads the latest Ubuntu image and writes it to a microSD card. Based on the instructions from: https://wiki.ubuntu.com/ARM/RaspberryPi For recommended SD card brands, see: http://elinux.org/RPi_SD_cards Note,...
def init_ubuntu_disk(self, yes=0): """ Downloads the latest Ubuntu image and writes it to a microSD card. Based on the instructions from: https://wiki.ubuntu.com/ARM/RaspberryPi For recommended SD card brands, see: http://elinux.org/RPi_SD_cards Note,...
[ "Downloads", "the", "latest", "Ubuntu", "image", "and", "writes", "it", "to", "a", "microSD", "card", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/rpi.py#L170-L218
[ "def", "init_ubuntu_disk", "(", "self", ",", "yes", "=", "0", ")", ":", "self", ".", "assume_localhost", "(", ")", "yes", "=", "int", "(", "yes", ")", "if", "not", "self", ".", "dryrun", ":", "device_question", "=", "'SD card present at %s? '", "%", "sel...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
RaspberryPiSatchel.init_raspbian_vm
Creates an image for running Raspbian in a QEMU virtual machine. Based on the guide at: https://github.com/dhruvvyas90/qemu-rpi-kernel/wiki/Emulating-Jessie-image-with-4.1.x-kernel
burlap/rpi.py
def init_raspbian_vm(self): """ Creates an image for running Raspbian in a QEMU virtual machine. Based on the guide at: https://github.com/dhruvvyas90/qemu-rpi-kernel/wiki/Emulating-Jessie-image-with-4.1.x-kernel """ r = self.local_renderer r.comment('Inst...
def init_raspbian_vm(self): """ Creates an image for running Raspbian in a QEMU virtual machine. Based on the guide at: https://github.com/dhruvvyas90/qemu-rpi-kernel/wiki/Emulating-Jessie-image-with-4.1.x-kernel """ r = self.local_renderer r.comment('Inst...
[ "Creates", "an", "image", "for", "running", "Raspbian", "in", "a", "QEMU", "virtual", "machine", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/rpi.py#L222-L273
[ "def", "init_raspbian_vm", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "r", ".", "comment", "(", "'Installing system packages.'", ")", "r", ".", "sudo", "(", "'add-apt-repository ppa:linaro-maintainers/tools'", ")", "r", ".", "sudo", "(", "'a...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
RaspberryPiSatchel.create_raspbian_vagrant_box
Creates a box for easily spinning up a virtual machine with Vagrant. http://unix.stackexchange.com/a/222907/16477 https://github.com/pradels/vagrant-libvirt
burlap/rpi.py
def create_raspbian_vagrant_box(self): """ Creates a box for easily spinning up a virtual machine with Vagrant. http://unix.stackexchange.com/a/222907/16477 https://github.com/pradels/vagrant-libvirt """ r = self.local_renderer r.sudo('adduser --disabled-passwo...
def create_raspbian_vagrant_box(self): """ Creates a box for easily spinning up a virtual machine with Vagrant. http://unix.stackexchange.com/a/222907/16477 https://github.com/pradels/vagrant-libvirt """ r = self.local_renderer r.sudo('adduser --disabled-passwo...
[ "Creates", "a", "box", "for", "easily", "spinning", "up", "a", "virtual", "machine", "with", "Vagrant", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/rpi.py#L276-L344
[ "def", "create_raspbian_vagrant_box", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "r", ".", "sudo", "(", "'adduser --disabled-password --gecos \"\" vagrant'", ")", "#vagrant user should be able to run sudo commands without a password prompt", "r", ".", "su...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
RaspberryPiSatchel.configure_hdmi
Configures HDMI to support hot-plugging, so it'll work even if it wasn't plugged in when the Pi was originally powered up. Note, this does cause slightly higher power consumption, so if you don't need HDMI, don't bother with this. http://raspberrypi.stackexchange.com/a/2171/29103
burlap/rpi.py
def configure_hdmi(self): """ Configures HDMI to support hot-plugging, so it'll work even if it wasn't plugged in when the Pi was originally powered up. Note, this does cause slightly higher power consumption, so if you don't need HDMI, don't bother with this. http://ra...
def configure_hdmi(self): """ Configures HDMI to support hot-plugging, so it'll work even if it wasn't plugged in when the Pi was originally powered up. Note, this does cause slightly higher power consumption, so if you don't need HDMI, don't bother with this. http://ra...
[ "Configures", "HDMI", "to", "support", "hot", "-", "plugging", "so", "it", "ll", "work", "even", "if", "it", "wasn", "t", "plugged", "in", "when", "the", "Pi", "was", "originally", "powered", "up", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/rpi.py#L400-L427
[ "def", "configure_hdmi", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "# use HDMI mode even if no HDMI monitor is detected", "r", ".", "enable_attr", "(", "filename", "=", "'/boot/config.txt'", ",", "key", "=", "'hdmi_force_hotplug'", ",", "value", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
RaspberryPiSatchel.configure_camera
Enables access to the camera. http://raspberrypi.stackexchange.com/questions/14229/how-can-i-enable-the-camera-without-using-raspi-config https://mike632t.wordpress.com/2014/06/26/raspberry-pi-camera-setup/ Afterwards, test with: /opt/vc/bin/raspistill --nopreview --output...
burlap/rpi.py
def configure_camera(self): """ Enables access to the camera. http://raspberrypi.stackexchange.com/questions/14229/how-can-i-enable-the-camera-without-using-raspi-config https://mike632t.wordpress.com/2014/06/26/raspberry-pi-camera-setup/ Afterwards, test with: ...
def configure_camera(self): """ Enables access to the camera. http://raspberrypi.stackexchange.com/questions/14229/how-can-i-enable-the-camera-without-using-raspi-config https://mike632t.wordpress.com/2014/06/26/raspberry-pi-camera-setup/ Afterwards, test with: ...
[ "Enables", "access", "to", "the", "camera", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/rpi.py#L439-L514
[ "def", "configure_camera", "(", "self", ")", ":", "#TODO:check per OS? Works on Raspbian Jessie", "r", "=", "self", ".", "local_renderer", "if", "self", ".", "env", ".", "camera_enabled", ":", "r", ".", "pc", "(", "'Enabling camera.'", ")", "#TODO:fix, doesn't work ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
RaspberryPiSatchel.fix_lsmod_for_pi3
Some images purporting to support both the Pi2 and Pi3 use the wrong kernel modules.
burlap/rpi.py
def fix_lsmod_for_pi3(self): """ Some images purporting to support both the Pi2 and Pi3 use the wrong kernel modules. """ r = self.local_renderer r.env.rpi2_conf = '/etc/modules-load.d/rpi2.conf' r.sudo("sed '/bcm2808_rng/d' {rpi2_conf}") r.sudo("echo bcm2835_rng ...
def fix_lsmod_for_pi3(self): """ Some images purporting to support both the Pi2 and Pi3 use the wrong kernel modules. """ r = self.local_renderer r.env.rpi2_conf = '/etc/modules-load.d/rpi2.conf' r.sudo("sed '/bcm2808_rng/d' {rpi2_conf}") r.sudo("echo bcm2835_rng ...
[ "Some", "images", "purporting", "to", "support", "both", "the", "Pi2", "and", "Pi3", "use", "the", "wrong", "kernel", "modules", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/rpi.py#L517-L524
[ "def", "fix_lsmod_for_pi3", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "r", ".", "env", ".", "rpi2_conf", "=", "'/etc/modules-load.d/rpi2.conf'", "r", ".", "sudo", "(", "\"sed '/bcm2808_rng/d' {rpi2_conf}\"", ")", "r", ".", "sudo", "(", "\...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ServiceManagementSatchel.pre_deploy
Runs methods services have requested be run before each deployment.
burlap/service.py
def pre_deploy(self): """ Runs methods services have requested be run before each deployment. """ for service in self.genv.services: service = service.strip().upper() funcs = common.service_pre_deployers.get(service) if funcs: print('Ru...
def pre_deploy(self): """ Runs methods services have requested be run before each deployment. """ for service in self.genv.services: service = service.strip().upper() funcs = common.service_pre_deployers.get(service) if funcs: print('Ru...
[ "Runs", "methods", "services", "have", "requested", "be", "run", "before", "each", "deployment", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/service.py#L225-L235
[ "def", "pre_deploy", "(", "self", ")", ":", "for", "service", "in", "self", ".", "genv", ".", "services", ":", "service", "=", "service", ".", "strip", "(", ")", ".", "upper", "(", ")", "funcs", "=", "common", ".", "service_pre_deployers", ".", "get", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ServiceManagementSatchel.deploy
Applies routine, typically application-level changes to the service.
burlap/service.py
def deploy(self): """ Applies routine, typically application-level changes to the service. """ for service in self.genv.services: service = service.strip().upper() funcs = common.service_deployers.get(service) if funcs: print('Deploying...
def deploy(self): """ Applies routine, typically application-level changes to the service. """ for service in self.genv.services: service = service.strip().upper() funcs = common.service_deployers.get(service) if funcs: print('Deploying...
[ "Applies", "routine", "typically", "application", "-", "level", "changes", "to", "the", "service", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/service.py#L238-L249
[ "def", "deploy", "(", "self", ")", ":", "for", "service", "in", "self", ".", "genv", ".", "services", ":", "service", "=", "service", ".", "strip", "(", ")", ".", "upper", "(", ")", "funcs", "=", "common", ".", "service_deployers", ".", "get", "(", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ServiceManagementSatchel.post_deploy
Runs methods services have requested be run before after deployment.
burlap/service.py
def post_deploy(self): """ Runs methods services have requested be run before after deployment. """ for service in self.genv.services: service = service.strip().upper() self.vprint('post_deploy:', service) funcs = common.service_post_deployers.get(serv...
def post_deploy(self): """ Runs methods services have requested be run before after deployment. """ for service in self.genv.services: service = service.strip().upper() self.vprint('post_deploy:', service) funcs = common.service_post_deployers.get(serv...
[ "Runs", "methods", "services", "have", "requested", "be", "run", "before", "after", "deployment", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/service.py#L252-L267
[ "def", "post_deploy", "(", "self", ")", ":", "for", "service", "in", "self", ".", "genv", ".", "services", ":", "service", "=", "service", ".", "strip", "(", ")", ".", "upper", "(", ")", "self", ".", "vprint", "(", "'post_deploy:'", ",", "service", "...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ServiceManagementSatchel.pre_db_dump
Runs methods services that have requested to be run before each database dump.
burlap/service.py
def pre_db_dump(self): """ Runs methods services that have requested to be run before each database dump. """ for service in self.genv.services: service = service.strip().upper() funcs = common.service_pre_db_dumpers.get(service) if funcs: ...
def pre_db_dump(self): """ Runs methods services that have requested to be run before each database dump. """ for service in self.genv.services: service = service.strip().upper() funcs = common.service_pre_db_dumpers.get(service) if funcs: ...
[ "Runs", "methods", "services", "that", "have", "requested", "to", "be", "run", "before", "each", "database", "dump", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/service.py#L277-L288
[ "def", "pre_db_dump", "(", "self", ")", ":", "for", "service", "in", "self", ".", "genv", ".", "services", ":", "service", "=", "service", ".", "strip", "(", ")", ".", "upper", "(", ")", "funcs", "=", "common", ".", "service_pre_db_dumpers", ".", "get"...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ServiceManagementSatchel.post_db_dump
Runs methods services that have requested to be run before each database dump.
burlap/service.py
def post_db_dump(self): """ Runs methods services that have requested to be run before each database dump. """ for service in self.genv.services: service = service.strip().upper() funcs = common.service_post_db_dumpers.get(service) if funcs: ...
def post_db_dump(self): """ Runs methods services that have requested to be run before each database dump. """ for service in self.genv.services: service = service.strip().upper() funcs = common.service_post_db_dumpers.get(service) if funcs: ...
[ "Runs", "methods", "services", "that", "have", "requested", "to", "be", "run", "before", "each", "database", "dump", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/service.py#L291-L302
[ "def", "post_db_dump", "(", "self", ")", ":", "for", "service", "in", "self", ".", "genv", ".", "services", ":", "service", "=", "service", ".", "strip", "(", ")", ".", "upper", "(", ")", "funcs", "=", "common", ".", "service_post_db_dumpers", ".", "ge...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ServiceManagementSatchel.configure
Applies one-time settings changes to the host, usually to initialize the service.
burlap/service.py
def configure(self): """ Applies one-time settings changes to the host, usually to initialize the service. """ print('env.services:', self.genv.services) for service in list(self.genv.services): service = service.strip().upper() funcs = common.service_conf...
def configure(self): """ Applies one-time settings changes to the host, usually to initialize the service. """ print('env.services:', self.genv.services) for service in list(self.genv.services): service = service.strip().upper() funcs = common.service_conf...
[ "Applies", "one", "-", "time", "settings", "changes", "to", "the", "host", "usually", "to", "initialize", "the", "service", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/service.py#L312-L326
[ "def", "configure", "(", "self", ")", ":", "print", "(", "'env.services:'", ",", "self", ".", "genv", ".", "services", ")", "for", "service", "in", "list", "(", "self", ".", "genv", ".", "services", ")", ":", "service", "=", "service", ".", "strip", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
LocalesSatchel.get_locale_dict
Reads /etc/default/locale and returns a dictionary representing its key pairs.
burlap/locale.py
def get_locale_dict(self, text=None): """ Reads /etc/default/locale and returns a dictionary representing its key pairs. """ text = text or self.cat_locale() # Format NAME="value". return dict(re.findall(r'^([a-zA-Z_]+)\s*=\s*[\'\"]*([0-8a-zA-Z_\.\:\-]+)[\'\"]*', text, re...
def get_locale_dict(self, text=None): """ Reads /etc/default/locale and returns a dictionary representing its key pairs. """ text = text or self.cat_locale() # Format NAME="value". return dict(re.findall(r'^([a-zA-Z_]+)\s*=\s*[\'\"]*([0-8a-zA-Z_\.\:\-]+)[\'\"]*', text, re...
[ "Reads", "/", "etc", "/", "default", "/", "locale", "and", "returns", "a", "dictionary", "representing", "its", "key", "pairs", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/locale.py#L31-L37
[ "def", "get_locale_dict", "(", "self", ",", "text", "=", "None", ")", ":", "text", "=", "text", "or", "self", ".", "cat_locale", "(", ")", "# Format NAME=\"value\".", "return", "dict", "(", "re", ".", "findall", "(", "r'^([a-zA-Z_]+)\\s*=\\s*[\\'\\\"]*([0-8a-zA-...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ApacheSatchel.enable_mods
Enables all modules in the current module list. Does not disable any currently enabled modules not in the list.
burlap/apache.py
def enable_mods(self): """ Enables all modules in the current module list. Does not disable any currently enabled modules not in the list. """ r = self.local_renderer for mod_name in r.env.mods_enabled: with self.settings(warn_only=True): self....
def enable_mods(self): """ Enables all modules in the current module list. Does not disable any currently enabled modules not in the list. """ r = self.local_renderer for mod_name in r.env.mods_enabled: with self.settings(warn_only=True): self....
[ "Enables", "all", "modules", "in", "the", "current", "module", "list", ".", "Does", "not", "disable", "any", "currently", "enabled", "modules", "not", "in", "the", "list", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/apache.py#L260-L268
[ "def", "enable_mods", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "for", "mod_name", "in", "r", ".", "env", ".", "mods_enabled", ":", "with", "self", ".", "settings", "(", "warn_only", "=", "True", ")", ":", "self", ".", "enable_mod...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ApacheSatchel.optimize_wsgi_processes
Based on the number of sites per server and the number of resources on the server, calculates the optimal number of processes that should be allocated for each WSGI site.
burlap/apache.py
def optimize_wsgi_processes(self): """ Based on the number of sites per server and the number of resources on the server, calculates the optimal number of processes that should be allocated for each WSGI site. """ r = self.local_renderer #r.env.wsgi_processes = 5 ...
def optimize_wsgi_processes(self): """ Based on the number of sites per server and the number of resources on the server, calculates the optimal number of processes that should be allocated for each WSGI site. """ r = self.local_renderer #r.env.wsgi_processes = 5 ...
[ "Based", "on", "the", "number", "of", "sites", "per", "server", "and", "the", "number", "of", "resources", "on", "the", "server", "calculates", "the", "optimal", "number", "of", "processes", "that", "should", "be", "allocated", "for", "each", "WSGI", "site",...
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/apache.py#L279-L290
[ "def", "optimize_wsgi_processes", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "#r.env.wsgi_processes = 5", "r", ".", "env", ".", "wsgi_server_memory_gb", "=", "8", "verbose", "=", "self", ".", "verbose", "all_sites", "=", "list", "(", "self...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ApacheSatchel.create_local_renderer
Instantiates a new local renderer. Override this to do any additional initialization.
burlap/apache.py
def create_local_renderer(self): """ Instantiates a new local renderer. Override this to do any additional initialization. """ r = super(ApacheSatchel, self).create_local_renderer() # Dynamically set values based on target operating system. os_version = self.os_v...
def create_local_renderer(self): """ Instantiates a new local renderer. Override this to do any additional initialization. """ r = super(ApacheSatchel, self).create_local_renderer() # Dynamically set values based on target operating system. os_version = self.os_v...
[ "Instantiates", "a", "new", "local", "renderer", ".", "Override", "this", "to", "do", "any", "additional", "initialization", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/apache.py#L308-L320
[ "def", "create_local_renderer", "(", "self", ")", ":", "r", "=", "super", "(", "ApacheSatchel", ",", "self", ")", ".", "create_local_renderer", "(", ")", "# Dynamically set values based on target operating system.", "os_version", "=", "self", ".", "os_version", "apach...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ApacheSatchel.install_auth_basic_user_file
Installs users for basic httpd auth.
burlap/apache.py
def install_auth_basic_user_file(self, site=None): """ Installs users for basic httpd auth. """ r = self.local_renderer hostname = self.current_hostname target_sites = self.genv.available_sites_by_host.get(hostname, None) for _site, site_data in self.iter_sites...
def install_auth_basic_user_file(self, site=None): """ Installs users for basic httpd auth. """ r = self.local_renderer hostname = self.current_hostname target_sites = self.genv.available_sites_by_host.get(hostname, None) for _site, site_data in self.iter_sites...
[ "Installs", "users", "for", "basic", "httpd", "auth", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/apache.py#L366-L400
[ "def", "install_auth_basic_user_file", "(", "self", ",", "site", "=", "None", ")", ":", "r", "=", "self", ".", "local_renderer", "hostname", "=", "self", ".", "current_hostname", "target_sites", "=", "self", ".", "genv", ".", "available_sites_by_host", ".", "g...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ApacheSatchel.sync_media
Uploads select media to an Apache accessible directory.
burlap/apache.py
def sync_media(self, sync_set=None, clean=0, iter_local_paths=0): """ Uploads select media to an Apache accessible directory. """ # Ensure a site is selected. self.genv.SITE = self.genv.SITE or self.genv.default_site r = self.local_renderer clean = int(clean) ...
def sync_media(self, sync_set=None, clean=0, iter_local_paths=0): """ Uploads select media to an Apache accessible directory. """ # Ensure a site is selected. self.genv.SITE = self.genv.SITE or self.genv.default_site r = self.local_renderer clean = int(clean) ...
[ "Uploads", "select", "media", "to", "an", "Apache", "accessible", "directory", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/apache.py#L411-L456
[ "def", "sync_media", "(", "self", ",", "sync_set", "=", "None", ",", "clean", "=", "0", ",", "iter_local_paths", "=", "0", ")", ":", "# Ensure a site is selected.", "self", ".", "genv", ".", "SITE", "=", "self", ".", "genv", ".", "SITE", "or", "self", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ApacheSatchel.get_media_timestamp
Called after a deployment to record any data necessary to detect changes for a future deployment.
burlap/apache.py
def get_media_timestamp(self): """ Called after a deployment to record any data necessary to detect changes for a future deployment. """ from burlap.common import get_last_modified_timestamp data = 0 for path in self.sync_media(iter_local_paths=1): dat...
def get_media_timestamp(self): """ Called after a deployment to record any data necessary to detect changes for a future deployment. """ from burlap.common import get_last_modified_timestamp data = 0 for path in self.sync_media(iter_local_paths=1): dat...
[ "Called", "after", "a", "deployment", "to", "record", "any", "data", "necessary", "to", "detect", "changes", "for", "a", "future", "deployment", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/apache.py#L458-L470
[ "def", "get_media_timestamp", "(", "self", ")", ":", "from", "burlap", ".", "common", "import", "get_last_modified_timestamp", "data", "=", "0", "for", "path", "in", "self", ".", "sync_media", "(", "iter_local_paths", "=", "1", ")", ":", "data", "=", "min", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ApacheSatchel.record_manifest
Called after a deployment to record any data necessary to detect changes for a future deployment.
burlap/apache.py
def record_manifest(self): """ Called after a deployment to record any data necessary to detect changes for a future deployment. """ manifest = super(ApacheSatchel, self).record_manifest() manifest['available_sites'] = self.genv.available_sites manifest['available...
def record_manifest(self): """ Called after a deployment to record any data necessary to detect changes for a future deployment. """ manifest = super(ApacheSatchel, self).record_manifest() manifest['available_sites'] = self.genv.available_sites manifest['available...
[ "Called", "after", "a", "deployment", "to", "record", "any", "data", "necessary", "to", "detect", "changes", "for", "a", "future", "deployment", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/apache.py#L473-L482
[ "def", "record_manifest", "(", "self", ")", ":", "manifest", "=", "super", "(", "ApacheSatchel", ",", "self", ")", ".", "record_manifest", "(", ")", "manifest", "[", "'available_sites'", "]", "=", "self", ".", "genv", ".", "available_sites", "manifest", "[",...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ApacheSatchel.configure_modevasive
Installs the mod-evasive Apache module for combating DDOS attacks. https://www.linode.com/docs/websites/apache-tips-and-tricks/modevasive-on-apache
burlap/apache.py
def configure_modevasive(self): """ Installs the mod-evasive Apache module for combating DDOS attacks. https://www.linode.com/docs/websites/apache-tips-and-tricks/modevasive-on-apache """ r = self.local_renderer if r.env.modevasive_enabled: self.install_packa...
def configure_modevasive(self): """ Installs the mod-evasive Apache module for combating DDOS attacks. https://www.linode.com/docs/websites/apache-tips-and-tricks/modevasive-on-apache """ r = self.local_renderer if r.env.modevasive_enabled: self.install_packa...
[ "Installs", "the", "mod", "-", "evasive", "Apache", "module", "for", "combating", "DDOS", "attacks", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/apache.py#L485-L516
[ "def", "configure_modevasive", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "if", "r", ".", "env", ".", "modevasive_enabled", ":", "self", ".", "install_packages", "(", ")", "# Write conf for each Ubuntu version since they don't conflict.", "fn", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ApacheSatchel.configure_modsecurity
Installs the mod-security Apache module. https://www.modsecurity.org
burlap/apache.py
def configure_modsecurity(self): """ Installs the mod-security Apache module. https://www.modsecurity.org """ r = self.local_renderer if r.env.modsecurity_enabled and not self.last_manifest.modsecurity_enabled: self.install_packages() # Write mo...
def configure_modsecurity(self): """ Installs the mod-security Apache module. https://www.modsecurity.org """ r = self.local_renderer if r.env.modsecurity_enabled and not self.last_manifest.modsecurity_enabled: self.install_packages() # Write mo...
[ "Installs", "the", "mod", "-", "security", "Apache", "module", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/apache.py#L519-L555
[ "def", "configure_modsecurity", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "if", "r", ".", "env", ".", "modsecurity_enabled", "and", "not", "self", ".", "last_manifest", ".", "modsecurity_enabled", ":", "self", ".", "install_packages", "("...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ApacheSatchel.configure_modrpaf
Installs the mod-rpaf Apache module. https://github.com/gnif/mod_rpaf
burlap/apache.py
def configure_modrpaf(self): """ Installs the mod-rpaf Apache module. https://github.com/gnif/mod_rpaf """ r = self.local_renderer if r.env.modrpaf_enabled: self.install_packages() self.enable_mod('rpaf') else: if self.last_man...
def configure_modrpaf(self): """ Installs the mod-rpaf Apache module. https://github.com/gnif/mod_rpaf """ r = self.local_renderer if r.env.modrpaf_enabled: self.install_packages() self.enable_mod('rpaf') else: if self.last_man...
[ "Installs", "the", "mod", "-", "rpaf", "Apache", "module", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/apache.py#L558-L570
[ "def", "configure_modrpaf", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "if", "r", ".", "env", ".", "modrpaf_enabled", ":", "self", ".", "install_packages", "(", ")", "self", ".", "enable_mod", "(", "'rpaf'", ")", "else", ":", "if", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ApacheSatchel.configure_site
Configures Apache to host one or more websites.
burlap/apache.py
def configure_site(self, full=1, site=None, delete_old=0): """ Configures Apache to host one or more websites. """ from burlap import service r = self.local_renderer print('Configuring Apache...', file=sys.stderr) site = site or self.genv.SITE if int(d...
def configure_site(self, full=1, site=None, delete_old=0): """ Configures Apache to host one or more websites. """ from burlap import service r = self.local_renderer print('Configuring Apache...', file=sys.stderr) site = site or self.genv.SITE if int(d...
[ "Configures", "Apache", "to", "host", "one", "or", "more", "websites", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/apache.py#L573-L657
[ "def", "configure_site", "(", "self", ",", "full", "=", "1", ",", "site", "=", "None", ",", "delete_old", "=", "0", ")", ":", "from", "burlap", "import", "service", "r", "=", "self", ".", "local_renderer", "print", "(", "'Configuring Apache...'", ",", "f...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
ApacheSatchel.maint_up
Forwards all traffic to a page saying the server is down for maintenance.
burlap/apache.py
def maint_up(self): """ Forwards all traffic to a page saying the server is down for maintenance. """ r = self.local_renderer fn = self.render_to_file(r.env.maintenance_template, extra={'current_hostname': self.current_hostname}) r.put(local_path=fn, remote_path=r.env.mai...
def maint_up(self): """ Forwards all traffic to a page saying the server is down for maintenance. """ r = self.local_renderer fn = self.render_to_file(r.env.maintenance_template, extra={'current_hostname': self.current_hostname}) r.put(local_path=fn, remote_path=r.env.mai...
[ "Forwards", "all", "traffic", "to", "a", "page", "saying", "the", "server", "is", "down", "for", "maintenance", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/apache.py#L660-L667
[ "def", "maint_up", "(", "self", ")", ":", "r", "=", "self", ".", "local_renderer", "fn", "=", "self", ".", "render_to_file", "(", "r", ".", "env", ".", "maintenance_template", ",", "extra", "=", "{", "'current_hostname'", ":", "self", ".", "current_hostnam...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
SupervisorSatchel.restart
Supervisor can take a very long time to start and stop, so wait for it.
burlap/supervisor.py
def restart(self): """ Supervisor can take a very long time to start and stop, so wait for it. """ n = 60 sleep_n = int(self.env.max_restart_wait_minutes/10.*60) for _ in xrange(n): self.stop() if self.dryrun or not self.is_running(): ...
def restart(self): """ Supervisor can take a very long time to start and stop, so wait for it. """ n = 60 sleep_n = int(self.env.max_restart_wait_minutes/10.*60) for _ in xrange(n): self.stop() if self.dryrun or not self.is_running(): ...
[ "Supervisor", "can", "take", "a", "very", "long", "time", "to", "start", "and", "stop", "so", "wait", "for", "it", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/supervisor.py#L153-L172
[ "def", "restart", "(", "self", ")", ":", "n", "=", "60", "sleep_n", "=", "int", "(", "self", ".", "env", ".", "max_restart_wait_minutes", "/", "10.", "*", "60", ")", "for", "_", "in", "xrange", "(", "n", ")", ":", "self", ".", "stop", "(", ")", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd
valid
SupervisorSatchel.record_manifest
Called after a deployment to record any data necessary to detect changes for a future deployment.
burlap/supervisor.py
def record_manifest(self): """ Called after a deployment to record any data necessary to detect changes for a future deployment. """ data = super(SupervisorSatchel, self).record_manifest() # Celery deploys itself through supervisor, so monitor its changes too in Apache s...
def record_manifest(self): """ Called after a deployment to record any data necessary to detect changes for a future deployment. """ data = super(SupervisorSatchel, self).record_manifest() # Celery deploys itself through supervisor, so monitor its changes too in Apache s...
[ "Called", "after", "a", "deployment", "to", "record", "any", "data", "necessary", "to", "detect", "changes", "for", "a", "future", "deployment", "." ]
chrisspen/burlap
python
https://github.com/chrisspen/burlap/blob/a92b0a8e5206850bb777c74af8421ea8b33779bd/burlap/supervisor.py#L179-L198
[ "def", "record_manifest", "(", "self", ")", ":", "data", "=", "super", "(", "SupervisorSatchel", ",", "self", ")", ".", "record_manifest", "(", ")", "# Celery deploys itself through supervisor, so monitor its changes too in Apache site configs.", "for", "site_name", ",", ...
a92b0a8e5206850bb777c74af8421ea8b33779bd