mirror of
https://github.com/joshuaboniface/rffmpeg.git
synced 2026-01-23 02:24:03 +00:00
Add server_name field
It doesn't do any harm and makes my [script](https://github.com/aleksasiriski/hcloud-rffmpeg) possible to work. I've set so that `rffmpeg add` always uses "manual" as the name but that could also be an option just like weight.
This commit is contained in:
parent
883d433368
commit
eacf5f6f8c
1 changed files with 5 additions and 4 deletions
9
rffmpeg
9
rffmpeg
|
|
@ -240,7 +240,7 @@ def get_target_host(config):
|
|||
# Generate a mapping dictionary of hosts and processes
|
||||
host_mappings = dict()
|
||||
for host in hosts:
|
||||
hid, hostname, weight = host
|
||||
hid, hostname, weight, server_name = host
|
||||
|
||||
# Get the latest state
|
||||
with dbconn(config) as cur:
|
||||
|
|
@ -536,7 +536,7 @@ def run_control(config):
|
|||
try:
|
||||
with dbconn(config) as cur:
|
||||
cur.execute(
|
||||
"""CREATE TABLE hosts (id INTEGER PRIMARY KEY, hostname TEXT NOT NULL, weight INTEGER DEFAULT 1)"""
|
||||
"""CREATE TABLE hosts (id INTEGER PRIMARY KEY, hostname TEXT NOT NULL, weight INTEGER DEFAULT 1, server_name TEXT NOT NULL)"""
|
||||
)
|
||||
cur.execute(
|
||||
"""CREATE TABLE processes (id INTEGER PRIMARY KEY, host_id INTEGER, process_id INTEGER, cmd TEXT)"""
|
||||
|
|
@ -590,7 +590,7 @@ def run_control(config):
|
|||
}
|
||||
|
||||
for host in hosts:
|
||||
hid, hostname, weight = host
|
||||
hid, hostname, weight, server_name = host
|
||||
|
||||
# Get the latest state
|
||||
with dbconn(config) as cur:
|
||||
|
|
@ -705,7 +705,8 @@ def run_control(config):
|
|||
click.echo("Adding new host '{}'".format(host))
|
||||
with dbconn(config) as cur:
|
||||
cur.execute(
|
||||
"""INSERT INTO hosts (hostname, weight) VALUES (?, ?)""", (host, weight)
|
||||
"INSERT INTO hosts (hostname, weight, server_name) VALUES (?, ?, ?)",
|
||||
(host, weight, "manual"),
|
||||
)
|
||||
|
||||
rffmpeg_click.add_command(rffmpeg_click_add)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue