def role_host_add(role_name, hosts): """ :param role_name: string of role name, e.g. nova-proxy001 :param hosts: list of hosts, e.g. ['9A5A2614-D21D-B211-83F3-000000821800', EF1503DA-AEC8-119F-8567-000000821800] :return: """ cps_server.role_host_add(role_name, hosts) cps_server.cps_commit
def _add_role_to_proxy(proxy_id, proxy_num): dhcp_role_name = "dhcp" cps_server.role_host_add(dhcp_role_name, [proxy_id]) compute_proxy_role_name = '-'.join(["compute", proxy_num]) cps_server.role_host_add(compute_proxy_role_name, [proxy_id]) network_proxy_role_name = '-'.join(["network", proxy_num]) cps_server.role_host_add(network_proxy_role_name, [proxy_id]) blockstorage_proxy_role_name = '-'.join(["blockstorage", proxy_num]) cps_server.role_host_add(blockstorage_proxy_role_name, [proxy_id]) cps_server.cps_commit