Merge branch 'master' into debian
authorNikos Skalkotos <skalkoto@grnet.gr>
Mon, 26 Aug 2013 09:49:01 +0000 (12:49 +0300)
committerNikos Skalkotos <skalkoto@grnet.gr>
Mon, 26 Aug 2013 09:49:01 +0000 (12:49 +0300)
devflow.conf [new file with mode: 0644]
snf-image-helper/configure.ac
snf-image-host/configure.ac
snf-image-host/pithcat
version [new file with mode: 0644]
version.m4 [new file with mode: 0644]
version_template [new file with mode: 0644]

diff --git a/devflow.conf b/devflow.conf
new file mode 100644 (file)
index 0000000..bbfdcaa
--- /dev/null
@@ -0,0 +1,4 @@
+[ packages ]
+  [[ devflow ]]
+    version_file = "version.m4"
+    version_template = "version_template"
index 722f474..30439c6 100644 (file)
@@ -1,5 +1,6 @@
 AC_PREREQ(2.59)
-AC_INIT(snf-image-helper, 0.9.1, synnefo@googlegroups.com)
+m4_include([../version.m4])
+AC_INIT(snf-image-helper, devflow_version, synnefo@googlegroups.com)
 
 AC_CONFIG_AUX_DIR(autotools)
 AC_CONFIG_SRCDIR(configure)
index 2dbd044..67350f3 100644 (file)
@@ -1,5 +1,6 @@
 AC_PREREQ(2.59)
-AC_INIT(snf-image, 0.9.1, synnefo@googlegroups.com)
+m4_include([../version.m4])
+AC_INIT(snf-image, devflow_version, synnefo@googlegroups.com)
 
 AC_CONFIG_AUX_DIR(autotools)
 AC_CONFIG_SRCDIR(configure)
index 2bc541e..51f3614 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Copyright (C) 2011 GRNET S.A.
+# Copyright (C) 2011-2013 GRNET S.A.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -40,11 +40,12 @@ except ImportError:
 
 parser = OptionParser(usage='%prog [options] <URL>')
 parser.add_option('--db', dest='db', metavar='URI',
-        help='SQLAlchemy URI of the database [REQUIRED]')
+                  help='SQLAlchemy URI of the database [REQUIRED]')
 parser.add_option('--data', dest='data', metavar='DIR',
-        help='path to the directory where data are stored [REQUIRED]')
+                  help='path to the directory where data are'
+                       ' stored [REQUIRED]')
 parser.add_option('-s', action='store_true', dest='size', default=False,
-        help='print file size and exit')
+                  help='print file size and exit')
 
 LocationURL = namedtuple('LocationURL', ['account', 'container', 'object'])
 HashmapURL = namedtuple('HashmapURL', ['hash', 'size'])
@@ -84,9 +85,9 @@ def print_data(backend, url):
     if type(url) is LocationURL:
         account, container, object = url
         size, hashmap = backend.get_object_hashmap(account, account, container,
-                object)
+                                                   object)
     elif type(url) is HashmapURL:
-        hashmap = [hexlify(x) \
+        hashmap = [hexlify(x)
                    for x in backend.store.map_get(unhexlify(url.hash))]
         size = int(url.size)
     else:
@@ -113,7 +114,7 @@ def main():
         exit(1)
 
     data_path = environ['PITHCAT_INPUT_DATA'] if not options.data else \
-            options.data
+        options.data
 
     if not options.db and 'PITHCAT_INPUT_DB' not in environ:
         stderr.write("Pithos database uri is missing.\n")
@@ -121,7 +122,10 @@ def main():
 
     db_uri = environ['PITHCAT_INPUT_DB'] if not options.db else options.db
 
-    backend = ModularBackend(None, db_uri, None, data_path)
+    backend = ModularBackend(None,
+                             db_uri if type(url) in LocationURL else None,
+                             None,
+                             data_path)
 
     if options.size:
         print_size(backend, url)
diff --git a/version b/version
new file mode 100644 (file)
index 0000000..f374f66
--- /dev/null
+++ b/version
@@ -0,0 +1 @@
+0.9.1
diff --git a/version.m4 b/version.m4
new file mode 100644 (file)
index 0000000..7889ca7
--- /dev/null
@@ -0,0 +1 @@
+m4_define([devflow_version], [0.9.1])
diff --git a/version_template b/version_template
new file mode 100644 (file)
index 0000000..bee6d02
--- /dev/null
@@ -0,0 +1 @@
+m4_define([devflow_version], [%(DEVFLOW_VERSION)s])