diff --git a/.gitignore b/.gitignore index e360a4a..6ea59e6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.py[co] *.egg-info setup.cfg +/build/ +/dist/ diff --git a/.project b/.project new file mode 100644 index 0000000..0a0e3e9 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + lvcache + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/.pydevproject b/.pydevproject new file mode 100644 index 0000000..ad74947 --- /dev/null +++ b/.pydevproject @@ -0,0 +1,8 @@ + + + +/${PROJECT_DIR_NAME} + +python interpreter +Default + diff --git a/lvcache/cmd_create.py b/lvcache/cmd_create.py index 489b654..2ff2ff7 100644 --- a/lvcache/cmd_create.py +++ b/lvcache/cmd_create.py @@ -7,7 +7,7 @@ def adjust_512(num): - return 512 * (num/512) + return 512 * int(num/512) class Create(Command): diff --git a/lvcache/lvm.py b/lvcache/lvm.py index 5613d58..9a571d4 100644 --- a/lvcache/lvm.py +++ b/lvcache/lvm.py @@ -93,7 +93,7 @@ def cache_status(self): status = dict(zip(cache_status_fields, status.strip().split()[:len(cache_status_fields)])) - for k in status.keys(): + for k in list(status.keys()): if status[k].isdigit(): status[k] = int(status[k]) elif '/' in status[k]: @@ -111,7 +111,7 @@ def remove_cache_pool(self): self.log.info(line.strip()) def attach_cache_pool(self, cache_lv): - lvconvert('--type', 'cache', + lvconvert('--yes', '--type', 'cache', '--cachepool', '%s/%s' % (cache_lv.vg.name, cache_lv.name), '%s/%s' % (self.vg.name, self.name)) diff --git a/setup.py b/setup.py index 747d8f2..83615e5 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name='lvcache', - version='1.0.1', + version='1.0.2', description='Wrapper for creating cached LVM logical volumes', author='Lars Kellogg-Stedman', author_email='lars@oddbit.com',