Merge "Make mount_check option usable in containerized environments"
This commit is contained in:
@@ -3585,6 +3585,12 @@ def ismount_raw(path):
|
|||||||
# path/.. is the same i-node as path
|
# path/.. is the same i-node as path
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
# Device and inode checks are not properly working inside containerized
|
||||||
|
# environments, therefore using a workaround to check if there is a
|
||||||
|
# stubfile placed by an operator
|
||||||
|
if os.path.isfile(os.path.join(path, ".ismount")):
|
||||||
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3300,6 +3300,16 @@ cluster_dfw1 = http://dfw1.host/v1/
|
|||||||
finally:
|
finally:
|
||||||
shutil.rmtree(tmpdir)
|
shutil.rmtree(tmpdir)
|
||||||
|
|
||||||
|
def test_ismount_successes_stubfile(self):
|
||||||
|
tmpdir = mkdtemp()
|
||||||
|
fname = os.path.join(tmpdir, ".ismount")
|
||||||
|
try:
|
||||||
|
with open(fname, "w") as stubfile:
|
||||||
|
stubfile.write("")
|
||||||
|
self.assertTrue(utils.ismount(tmpdir))
|
||||||
|
finally:
|
||||||
|
shutil.rmtree(tmpdir)
|
||||||
|
|
||||||
def test_parse_content_type(self):
|
def test_parse_content_type(self):
|
||||||
self.assertEqual(utils.parse_content_type('text/plain'),
|
self.assertEqual(utils.parse_content_type('text/plain'),
|
||||||
('text/plain', []))
|
('text/plain', []))
|
||||||
|
|||||||
Reference in New Issue
Block a user