From 0d5e46ea593b48a92f8a800d2ef633a6e8858c7b Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 13 Oct 2012 15:50:34 +0200 Subject: admin account can now be configured in json file some bugfixes video encoder now use 8 threads --- src/flufigut.py | 20 ++++++++++-------- src/manage.sh | 7 ------- src/update.sh | 43 +++++++++++++++++++++++++++++++++++++++ templates/example/h264-encode.xml | 2 +- templates/example/vp8-encode.xml | 2 +- 5 files changed, 57 insertions(+), 17 deletions(-) create mode 100755 src/update.sh diff --git a/src/flufigut.py b/src/flufigut.py index ae4edb4..b1e04af 100755 --- a/src/flufigut.py +++ b/src/flufigut.py @@ -363,14 +363,18 @@ for w in worker: salt = rand_string(6) passwd.write("%s:%s\n" % (w, crypt.crypt(password, salt))); -user = raw_input("username of administrator: ") -if user == "": - raise SystemExit("WARN: empty username (not creating admin account)") - -password = getpass.getpass("password for '%s': " % user) -password2 = getpass.getpass("retype password for '%s': " % user) -if password != password2: - raise SystemExit("WARN: passwords don't match (not creating admin account)") +if "admin" in globals: + user = globals['admin']['username'] + password = globals['admin']['password'] +else: + user = raw_input("username of administrator (leave empty for none): ") + if user == "": + raise SystemExit("WARN: empty username (not creating admin account)") + + password = getpass.getpass("password for '%s': " % user) + password2 = getpass.getpass("retype password for '%s': " % user) + if password != password2: + raise SystemExit("WARN: passwords don't match (not creating admin account)") salt = rand_string(6) passwd.write("%s:%s\n" % (user, crypt.crypt(password, salt))); diff --git a/src/manage.sh b/src/manage.sh index d6fb813..76f2358 100755 --- a/src/manage.sh +++ b/src/manage.sh @@ -52,7 +52,6 @@ deploy_all() { tar -czf "$OUTPUT_DIR/$machine.tar.gz" "$OUTPUT_DIR/$machine"/* scp -i "$SSH_KEY" -F "$SSH_CONFIG" "$OUTPUT_DIR/$machine.tar.gz" $SSH_USER@"$machine":/tmp ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" install "/tmp/$machine.tar.gz" - rm "$OUTPUT_DIR/$machine.tar.gz" fi done } @@ -82,7 +81,6 @@ start_all() { echo " $machine (manager, worker)" generate_instance_list $machine ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" start < "$OUTPUT_DIR/$machine.list" - rm "$OUTPUT_DIR/$machine.list" break fi done @@ -92,8 +90,6 @@ start_all() { echo " $machine (worker)" generate_instance_list $machine ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" start < "$OUTPUT_DIR/$machine.list" - rm "$OUTPUT_DIR/$machine.list" - break fi done } @@ -105,8 +101,6 @@ stop_all() { echo " $machine (worker)" generate_instance_list $machine ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" stop < "$OUTPUT_DIR/$machine.list" - rm "$OUTPUT_DIR/$machine.list" - break fi done for machine in "$OUTPUT_DIR"/*; do @@ -115,7 +109,6 @@ stop_all() { echo " $machine (manager, worker)" generate_instance_list $machine ssh -i "$SSH_KEY" -F "$SSH_CONFIG" $SSH_USER@"$machine" stop < "$OUTPUT_DIR/$machine.list" - rm "$OUTPUT_DIR/$machine.list" break fi done diff --git a/src/update.sh b/src/update.sh new file mode 100755 index 0000000..ca4f028 --- /dev/null +++ b/src/update.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# +# flufigut +# +# flufigut, the flumotion configuration utility, is a simple tool +# that generates flumotion configuration files using pyhton jinja2 +# template engine and simplejson. flufigut generates planet.xml +# and worker.xml files from configuration templates and an easy to +# understand representation of the flow structure written in json. +# +# +# Copyright (C) 2012 Christian Pointner +# Michael Gebetsroither +# +# This file is part of flufigut. +# +# flufigut is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# any later version. +# +# flufigut is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with flufigut. If not, see . +# + +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + +TEMPLATES="example" + +./manage.sh stop +./flufigut.py "$TEMPLATES" $1 +./manage.sh deploy +./manage.sh start + +exit 0 diff --git a/templates/example/h264-encode.xml b/templates/example/h264-encode.xml index 9e85b0d..ba8b136 100644 --- a/templates/example/h264-encode.xml +++ b/templates/example/h264-encode.xml @@ -7,6 +7,6 @@ {{ component.feeder }} - ffmpegcolorspace ! x264enc bitrate={{ component.properties['bitrate'] }} profile=baseline threads=6 key-int-max=50 byte-stream=false pass=0 cabac=true bframes=0 + ffmpegcolorspace ! x264enc bitrate={{ component.properties['bitrate'] }} profile=baseline threads=8 key-int-max=50 byte-stream=false pass=0 cabac=true bframes=0 false diff --git a/templates/example/vp8-encode.xml b/templates/example/vp8-encode.xml index 8c3fc1c..424295f 100644 --- a/templates/example/vp8-encode.xml +++ b/templates/example/vp8-encode.xml @@ -9,6 +9,6 @@ 50 {{ component.properties['bitrate'] * 1000 }} - 6 + 8 false -- cgit v1.2.3