2022-04-25 09:53:20 +00:00
|
|
|
|
2022-07-12 09:59:19 +00:00
|
|
|
def dict_to_attrs(attrs: dict) -> str:
|
2022-06-09 13:08:11 +00:00
|
|
|
"""
|
2022-07-12 09:59:19 +00:00
|
|
|
This function takes a dictionary of object's attributes and converts them
|
|
|
|
into string. The string is passed to `--attributes` key of neofs-cli.
|
2022-04-25 09:53:20 +00:00
|
|
|
|
|
|
|
Args:
|
2022-06-09 13:08:11 +00:00
|
|
|
attrs (dict): object attributes in {"a": "b", "c": "d"} format.
|
2022-04-25 09:53:20 +00:00
|
|
|
|
|
|
|
Returns:
|
|
|
|
(str): string in "a=b,c=d" format.
|
2022-06-09 13:08:11 +00:00
|
|
|
"""
|
2022-07-12 09:59:19 +00:00
|
|
|
return ",".join(f"{key}={value}" for key, value in attrs.items())
|