From 871e04fb039971ec2cd1cfe4b470539483b0f10d Mon Sep 17 00:00:00 2001 From: Retspen Date: Wed, 13 May 2015 09:42:20 +0300 Subject: [PATCH] Fixed some bugs --- accounts/templates/profile.html | 6 ++--- console/novncd | 11 +++++---- dev/libvirt-bootstrap.sh | 28 +++++++++++++++++----- instances/templates/create_inst_block.html | 2 +- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/accounts/templates/profile.html b/accounts/templates/profile.html index 75d15fc..2a522b2 100644 --- a/accounts/templates/profile.html +++ b/accounts/templates/profile.html @@ -43,19 +43,19 @@
{% csrf_token %}
- +
- +
- +
diff --git a/console/novncd b/console/novncd index 25e23c1..cff4376 100755 --- a/console/novncd +++ b/console/novncd @@ -66,14 +66,15 @@ parser.add_option("-c", (options, args) = parser.parse_args() -FORMAT="%(asctime)s - %(name)s - %(levelname)s : %(message)s" + +FORMAT = "%(asctime)s - %(name)s - %(levelname)s : %(message)s" if options.debug: - logging.basicConfig(level=logging.DEBUG,format=FORMAT) - options.verbose=True + logging.basicConfig(level=logging.DEBUG, format=FORMAT) + options.verbose = True elif options.verbose: - logging.basicConfig(level=logging.INFO,format=FORMAT) + logging.basicConfig(level=logging.INFO, format=FORMAT) else: - logging.basicConfig(level=logging.WARNING,format=FORMAT) + logging.basicConfig(level=logging.WARNING, format=FORMAT) try: from websockify import WebSocketProxy diff --git a/dev/libvirt-bootstrap.sh b/dev/libvirt-bootstrap.sh index a15dc23..7877811 100644 --- a/dev/libvirt-bootstrap.sh +++ b/dev/libvirt-bootstrap.sh @@ -588,10 +588,21 @@ install_debian() { } install_debian_post() { - if [ -f /etc/default/libvirt-bin ]; then - sed -i 's/libvirtd_opts="-d"/libvirtd_opts="-d -l"/g' /etc/default/libvirt-bin + if [ $DISTRO_MAJOR_VERSION -ge 8 ]; then + LIBVIRTSVC=libvirtd else - echoerror "/etc/default/libvirt-bin not found. Exiting..." + LIBVIRTSVC=libvirt-bin + fi + if [ -f /etc/default/$LIBVIRTSVC ]; then + if [ "$( grep -c '^libvirtd_opts *=' /etc/default/$LIBVIRTSVC )" -gt 0 ]; then + if [ $( grep -c '^libvirtd_opts *=.*-l' /etc/default/$LIBVIRTSVC ) -eq 0 ]; then + sed -i 's/^libvirtd_opts="\([^"]*\)"/libvirtd_opts="\1 -l"/g' /etc/default/$LIBVIRTSVC + fi + else + sed -i 's/^#libvirtd_opts=.*$/libvirtd_opts="-l"/g' /etc/default/$LIBVIRTSVC + fi + else + echoerror "/etc/default/$LIBVIRTSVC not found. Exiting..." exit 1 fi if [ -f /etc/libvirt/libvirtd.conf ]; then @@ -612,9 +623,14 @@ install_debian_post() { } daemons_running_debian() { - if [ -f /etc/init.d/libvirt-bin ]; then - /etc/init.d/libvirt-bin stop > /dev/null 2>&1 - /etc/init.d/libvirt-bin start + if [ $DISTRO_MAJOR_VERSION -ge 8 ]; then + LIBVIRTSVC=libvirtd + else + LIBVIRTSVC=libvirt-bin + fi + if [ -f /etc/init.d/$LIBVIRTSVC ]; then + /etc/init.d/$LIBVIRTSVC stop > /dev/null 2>&1 + /etc/init.d/$LIBVIRTSVC start fi return 0 } diff --git a/instances/templates/create_inst_block.html b/instances/templates/create_inst_block.html index a063645..63fcc35 100644 --- a/instances/templates/create_inst_block.html +++ b/instances/templates/create_inst_block.html @@ -10,7 +10,7 @@