swiftonfile/gluster/swift/__init__.py
Peter Portante b291641985 Add DiskDir unit test skeleton and pep8 filter
The new DiskDir unit test skeleton is quite incomplete, but gets the
DiskDir module on the board for modules covered, explicitly exposing
the fact that we need to get test coverage. This is a first step.

At the same time, we also update all the modules we have applying the
fix for pep8 errors now run under tox. We can then add a Jenkins
pre-commit job to fail on pep8 errors. This brings our code to parity
with what they are doing in OpenStack Swift.

Change-Id: Ia0565606512efda6e73f67bd00269177b89db858
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Reviewed-on: http://review.gluster.org/5080
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
2013-05-24 12:08:18 -07:00

31 lines
888 B
Python

""" Gluster for Swift """
class PkgInfo(object):
def __init__(self, canonical_version, name, final):
self.canonical_version = canonical_version
self.name = name
self.final = final
def save_config(self, filename):
"""Crates a file with the package configuration
which can be sourced by a bash script"""
with open(filename, 'w') as fd:
fd.write("PKG_NAME=%s\n" % self.name)
fd.write("PKG_VERSION=%s\n" % self.canonical_version)
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' % (self.canonical_version,)
###
### Change the Package version here
###
_pkginfo = PkgInfo('1.8.0', 'glusterfs-openstack-swift', False)
__version__ = _pkginfo.pretty_version
__canonical_version__ = _pkginfo.canonical_version