[Pkg-ganeti-devel] [ganeti] 07/10: Add a bug-script for ganeti

Apollon Oikonomopoulos apoikos at moszumanska.debian.org
Mon Oct 6 07:17:23 UTC 2014


This is an automated email from the git hooks/post-receive script.

apoikos pushed a commit to branch master
in repository ganeti.

commit a81f0d035f61c7d761309bc2ece14bfcbd88048c
Author: Apollon Oikonomopoulos <apoikos at debian.org>
Date:   Thu Oct 2 09:23:24 2014 +0300

    Add a bug-script for ganeti
    
    Add a simple bug-script to attach the following information to bug
    reports:
    
     - Symlinks
     - Config version
     - Primary IP family
     - Enabled hypervisors and HVPs
    
    Also have ganeti depend on python directly to make lintian happy
    (although we depend on python indirectly anyway).
---
 debian/control           |  2 +-
 debian/ganeti.bug-script | 57 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index df3953b..19afc27 100644
--- a/debian/control
+++ b/debian/control
@@ -62,7 +62,7 @@ Depends: ganeti-2.11 (= ${source:Version}),
  ganeti-haskell-2.11 (<< ${source:Version}.1~),
  ganeti-htools-2.11 (>= ${source:Version}),
  ganeti-htools-2.11 (<< ${source:Version}.1~),
- adduser, ${misc:Depends}
+ adduser, python, ${misc:Depends}
 Recommends: drbd-utils | drbd8-utils (>= 8.0.7), qemu-kvm |
  xen-linux-system-amd64 | xen-linux-system-686-pae,
  ganeti-instance-debootstrap, ndisc6
diff --git a/debian/ganeti.bug-script b/debian/ganeti.bug-script
new file mode 100755
index 0000000..403888e
--- /dev/null
+++ b/debian/ganeti.bug-script
@@ -0,0 +1,57 @@
+#!/usr/bin/python
+
+# Attach some ganeti-specific information to bug reports
+
+import os
+import sys
+from socket import AF_INET6
+
+def read_ssconf(key):
+    try:
+        with open("/var/lib/ganeti/ssconf_%s" % key) as ssconf:
+            values = ssconf.readlines()
+    except EnvironmentError:
+        return []
+
+    return [v.strip() for v in values]
+
+out = os.fdopen(3, "w")
+
+try:
+    share = os.readlink("/etc/ganeti/share")
+except EnvironmentError:
+    share = ""
+
+try:
+    lib = os.readlink("/etc/ganeti/lib")
+except EnvironmentError:
+    lib = ""
+
+print >> out, """Version symlinks:
+  /etc/ganeti/share -> %s
+  /etc/ganeti/lib -> %s""" % (share, lib)
+
+if not os.path.exists("/var/lib/ganeti/ssconf_release_version"):
+    out.write("No cluster configuration found.\n")
+    sys.exit(0)
+
+version = read_ssconf("release_version")
+if version:
+    out.write("Cluster config version: %s\n" % version[0])
+
+af_pri = read_ssconf("primary_ip_family")
+if af_pri:
+    out.write("Address family: %s\n" %
+              ("IPv6" if af_pri[0] == str(AF_INET6) else "IPv4"))
+
+hv_list = read_ssconf("hypervisor_list")
+out.write("Enabled hypervisors: %s\n" % " ".join(hv_list))
+
+for hv in hv_list:
+    hvp = read_ssconf("hvparams_%s" %hv)
+    out.write("%s hypervisor parameters:\n" % hv)
+    for param in hvp:
+        # Skip unset parameters
+        if not param.split("=", 1)[-1]:
+            continue
+        out.write("  " + param + "\n")

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git



More information about the Pkg-ganeti-devel mailing list