Removed unused metadata key and do_rmdir func
Change-Id: Ibcef5d817390a11d85cf125bb9addfbfded1b019 Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5301 Reviewed-by: Mohammed Junaid <junaid@redhat.com> Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
This commit is contained in:
parent
8f46de60d8
commit
a737372032
@ -137,19 +137,6 @@ def do_unlink(path, log=True):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def do_rmdir(path):
|
|
||||||
try:
|
|
||||||
os.rmdir(path)
|
|
||||||
except OSError as err:
|
|
||||||
if err.errno != errno.ENOENT:
|
|
||||||
logging.exception("Rmdir failed on %s err: %s", path, err.strerror)
|
|
||||||
raise
|
|
||||||
res = False
|
|
||||||
else:
|
|
||||||
res = True
|
|
||||||
return res
|
|
||||||
|
|
||||||
|
|
||||||
def do_rename(old_path, new_path):
|
def do_rename(old_path, new_path):
|
||||||
try:
|
try:
|
||||||
os.rename(old_path, new_path)
|
os.rename(old_path, new_path)
|
||||||
|
@ -49,7 +49,6 @@ ASYNCDIR = 'async_pending' # Keep in sync with swift.obj.server.ASYNCDIR
|
|||||||
FILE = 'file'
|
FILE = 'file'
|
||||||
FILE_TYPE = 'application/octet-stream'
|
FILE_TYPE = 'application/octet-stream'
|
||||||
OBJECT = 'Object'
|
OBJECT = 'Object'
|
||||||
OBJECT_TYPE = 'application/octet-stream'
|
|
||||||
DEFAULT_UID = -1
|
DEFAULT_UID = -1
|
||||||
DEFAULT_GID = -1
|
DEFAULT_GID = -1
|
||||||
PICKLE_PROTOCOL = 2
|
PICKLE_PROTOCOL = 2
|
||||||
|
@ -237,24 +237,6 @@ class TestFsUtils(unittest.TestCase):
|
|||||||
finally:
|
finally:
|
||||||
os.rmdir(tmpdir)
|
os.rmdir(tmpdir)
|
||||||
|
|
||||||
def test_do_rmdir(self):
|
|
||||||
tmpdir = mkdtemp()
|
|
||||||
fs.do_rmdir(tmpdir)
|
|
||||||
assert not os.path.exists(tmpdir)
|
|
||||||
assert not fs.do_rmdir(os.path.join('/tmp', str(random.random())))
|
|
||||||
|
|
||||||
def test_do_rmdir_err(self):
|
|
||||||
fd, tmpfile = mkstemp()
|
|
||||||
try:
|
|
||||||
fs.do_rmdir(tmpfile)
|
|
||||||
except OSError:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
self.fail('OSError expected')
|
|
||||||
finally:
|
|
||||||
os.close(fd)
|
|
||||||
os.remove(tmpfile)
|
|
||||||
|
|
||||||
def test_do_rename(self):
|
def test_do_rename(self):
|
||||||
srcpath = mkdtemp()
|
srcpath = mkdtemp()
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user