Example #1
0
def acquire_filesystem_symlink_targets(pool_name, filesystem_name, pool_path,
                                       filesystem_path):
    """
    Acquire the symlink targets of the "/dev/stratis" symlink,
    and the equivalent device-mapper "/dev/mapper" link, generated
    via the info from get_managed_objects().
    NOTE: This may require a preceding "udevadm settle" call, to
    ensure that up-to-date pool and filesystem information is being
    collected.
    :param str pool_name: pool name
    :param str filesystem_name: filesystem name
    :param str pool_path: pool path
    :param str filesystem_path: filesystem path
    :return: str fsdevdest, str fsdevmapperlinkdest
    """
    objects = StratisDbus.get_managed_objects()

    pool_gmodata = objects[pool_path]
    pool_uuid = pool_gmodata[StratisDbus.POOL_IFACE]["Uuid"]
    filesystem_gmodata = objects[filesystem_path]
    filesystem_uuid = filesystem_gmodata[StratisDbus.FS_IFACE]["Uuid"]

    filesystem_devnode = "/dev/stratis/" + pool_name + "/" + filesystem_name

    fs_devmapperlinkstr = ("/dev/mapper/stratis-1-" + pool_uuid + "-thin-fs-" +
                           filesystem_uuid)

    fsdevdest = resolve_symlink(filesystem_devnode)
    fsdevmapperlinkdest = resolve_symlink(fs_devmapperlinkstr)
    return fsdevdest, fsdevmapperlinkdest
Example #2
0
 def test_get_managed_objects(self):
     """
     Test that GetManagedObjects returns a dict w/out failure.
     """
     self.assertIsInstance(StratisDbus.get_managed_objects(), type({}))
Example #3
0
 def test_get_managed_objects(self):
     """
     Test that GetManagedObjects returns a dict w/out failure.
     """
     result = StratisDbus.get_managed_objects()
     self.assertIsInstance(result, dict)
Example #4
0
 def test_get_managed_objects(self):
     """
     Test that GetManagedObjects returns a dict w/out failure.
     """
     self._inequality_test(StratisDbus.get_managed_objects(), {})