mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
Treat entire input as password
Instead of just the first line. PEP8 fixes.
This commit is contained in:
parent
21b9a5b02a
commit
0b1e97d99c
@ -95,7 +95,7 @@ def subcommand_get_sites(_):
|
||||
|
||||
def subcommand_create_wiki(arguments):
|
||||
"""Create a wiki."""
|
||||
pw_bytes = sys.stdin.readline().encode()
|
||||
pw_bytes = sys.stdin.read().encode()
|
||||
proc = subprocess.Popen(
|
||||
['ikiwiki', '-setup', SETUP_WIKI,
|
||||
arguments.wiki_name, arguments.admin_name],
|
||||
@ -107,7 +107,7 @@ def subcommand_create_wiki(arguments):
|
||||
|
||||
def subcommand_create_blog(arguments):
|
||||
"""Create a blog."""
|
||||
pw_bytes = sys.stdin.readline().encode()
|
||||
pw_bytes = sys.stdin.read().encode()
|
||||
proc = subprocess.Popen(
|
||||
['ikiwiki', '-setup', SETUP_BLOG,
|
||||
arguments.blog_name, arguments.admin_name],
|
||||
|
||||
@ -224,7 +224,7 @@ def subcommand_get_kite(_):
|
||||
def subcommand_set_kite(arguments):
|
||||
"""Set details of the kite"""
|
||||
aug.set(PATHS['kitename'], arguments.kite_name)
|
||||
aug.set(PATHS['kitesecret'], sys.stdin.readline())
|
||||
aug.set(PATHS['kitesecret'], sys.stdin.read())
|
||||
aug.save()
|
||||
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ def subcommand_disable(_):
|
||||
|
||||
def subcommand_merge_configuration(arguments):
|
||||
"""Merge given JSON configuration with existing configuration."""
|
||||
configuration = ''.join(sys.stdin.readlines())
|
||||
configuration = sys.stdin.read()
|
||||
configuration = json.loads(configuration)
|
||||
|
||||
current_configuration = open(TRANSMISSION_CONFIG, 'r').read()
|
||||
|
||||
@ -366,7 +366,7 @@ def _apply_changes(request, old_status, new_status):
|
||||
'-U', new_status['dynamicdns_update_url'],
|
||||
'-c', disable_ssl_check,
|
||||
'-b', use_http_basic_auth],
|
||||
input = new_status['dynamicdns_secret'].encode())
|
||||
input=new_status['dynamicdns_secret'].encode())
|
||||
|
||||
if old_status['enabled']:
|
||||
_run(['stop'])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user