Create a dictionary of devs indexed by roles :param roles: List of roles :param devs: Corresponding list of devices. :returns: Dictionary of devs indexed by roles.
(roles, devs)
| 305 | |
| 306 | |
| 307 | def assign_devs(roles, devs): |
| 308 | """ |
| 309 | Create a dictionary of devs indexed by roles |
| 310 | |
| 311 | :param roles: List of roles |
| 312 | :param devs: Corresponding list of devices. |
| 313 | :returns: Dictionary of devs indexed by roles. |
| 314 | """ |
| 315 | return dict(zip(roles, devs)) |
| 316 | |
| 317 | |
| 318 | @contextlib.contextmanager |