Include VCS version in `gnt-cluster version`
authorThomas Thrainer <thomasth@google.com>
Tue, 6 Aug 2013 10:54:15 +0000 (12:54 +0200)
committerThomas Thrainer <thomasth@google.com>
Tue, 6 Aug 2013 13:32:13 +0000 (15:32 +0200)
Also print the VCS version in the output of `gnt-cluster version`. This
makes the VCS version also available over RAPI, etc.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

lib/client/gnt_cluster.py
lib/cmdlib/cluster.py
lib/query.py
src/Ganeti/Query/Server.hs

index a6d3d01..e70361b 100644 (file)
@@ -351,6 +351,7 @@ def ShowClusterVersion(opts, args):
   ToStdout("Configuration format: %s", result["config_version"])
   ToStdout("OS api version: %s", result["os_api_version"])
   ToStdout("Export interface: %s", result["export_version"])
+  ToStdout("VCS version: %s", result["vcs_version"])
   return 0
 
 
index 658407b..d3c5aae 100644 (file)
@@ -291,6 +291,7 @@ class LUClusterQuery(NoHooksLU):
       "config_version": constants.CONFIG_VERSION,
       "os_api_version": max(constants.OS_API_VERSIONS),
       "export_version": constants.EXPORT_VERSION,
+      "vcs_version": constants.VCS_VERSION,
       "architecture": runtime.GetArchInfo(),
       "name": cluster.cluster_name,
       "master": cluster.master_node,
index 1516372..9bf5983 100644 (file)
@@ -2549,6 +2549,8 @@ _CLUSTER_VERSION_FIELDS = {
                      "API version for OS template scripts"),
   "export_version": ("ExportVersion", QFT_NUMBER, constants.EXPORT_VERSION,
                      "Import/export file format version"),
+  "vcs_version": ("VCSVersion", QFT_TEXT, constants.VCS_VERSION,
+                     "VCS version"),
   }
 
 
index 3839715..ef2f6b5 100644 (file)
@@ -96,6 +96,7 @@ handleCall cdata QueryClusterInfo =
             , ("config_version", showJSON C.configVersion)
             , ("os_api_version", showJSON $ maximum C.osApiVersions)
             , ("export_version", showJSON C.exportVersion)
+            , ("vcs_version", showJSON C.vcsVersion)
             , ("architecture", showJSON arch_tuple)
             , ("name", showJSON $ clusterClusterName cluster)
             , ("master", showJSON $ clusterMasterNode cluster)