def get_preparation_cmd(user, permissions, path):
    """
    Generates the command lines for adjusting a volume's ownership and permission flags. Returns an empty list if there
    is nothing to adjust.

    :param user: User to set ownership for on the path via ``chown``.
    :type user: unicode | str | int | dockermap.functional.AbstractLazyObject
    :param permissions: Permission flags to set via ``chmod``.
    :type permissions: unicode | str | dockermap.functional.AbstractLazyObject
    :param path: Path to adjust permissions on.
    :type path: unicode | str
    :return: Iterator over resulting command strings.
    :rtype: collections.Iterable[unicode | str]
    """
    r_user = resolve_value(user)
    r_permissions = resolve_value(permissions)
    if user:
        yield chown(r_user, path)
    if permissions:
        yield chmod(r_permissions, path)
def get_preparation_cmd ( user , permissions , path ) : r_user = resolve_value ( user ) r_permissions = resolve_value ( permissions ) if user : yield chown ( r_user , path ) if permissions : yield chmod ( r_permissions , path )
Generates the command lines for adjusting a volume's ownership and permission flags. Returns an empty list if there
    is nothing to adjust.

    :param user: User to set ownership for on the path via ``chown``.
    :type user: unicode | str | int | dockermap.functional.AbstractLazyObject
    :param permissions: Permission flags to set via ``chmod``.
    :type permissions: unicode | str | dockermap.functional.AbstractLazyObject
    :param path: Path to adjust permissions on.
    :type path: unicode | str
    :return: Iterator over resulting command strings.
    :rtype: collections.Iterable[unicode | str]