From 8925faaa9de92373e54fc999a38e5edb6281acd7 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Thu, 16 Aug 2007 15:13:03 +0000
Subject: [PATCH] Some small fixes.

It fixes the main Makefile.am to create $localstatedir/{lib,log}/ganeti.
It fixes the testing Makefile.am after the rename fake_config.py ->
mocks.py.  It strips the output of "ip link show" to have a nicer output
if the master netdev does not exist.
---
 Makefile.am         | 3 +++
 lib/cmdlib.py       | 3 ++-
 testing/Makefile.am | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index fa3a0a5d3..def0e725f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,3 +15,6 @@ depgraph.ps: depgraph.dot
 depgraph.dot: ganeti/*.py
 	pylint.python2.4 --indent-string '  ' --rcfile=/dev/null \
 	  --reports y --int-import-graph $@ --persistent n ganeti >/dev/null
+
+install-exec-local:
+	@mkdir_p@ ${localstatedir}/lib/ganeti ${localstatedir}/log/ganeti
diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index a884489b3..c726bf15d 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -580,7 +580,8 @@ class LUInitCluster(LogicalUnit):
     result = utils.RunCmd(["ip", "link", "show", "dev", self.op.master_netdev])
     if result.failed:
       raise errors.OpPrereqError("Invalid master netdev given (%s): '%s'" %
-                                 (self.op.master_netdev, result.output))
+                                 (self.op.master_netdev,
+                                  result.output.strip()))
 
   def Exec(self, feedback_fn):
     """Initialize the cluster.
diff --git a/testing/Makefile.am b/testing/Makefile.am
index 115bce235..732c182f5 100644
--- a/testing/Makefile.am
+++ b/testing/Makefile.am
@@ -6,4 +6,4 @@ ganeti:
 	rm -f ganeti
 	ln -s $(top_srcdir)/lib ganeti
 
-EXTRA_DIST = $(TESTS) fake_config.py ganeti.qa.py qa-sample.yaml
+EXTRA_DIST = $(TESTS) mocks.py ganeti.qa.py qa-sample.yaml
-- 
GitLab