# coding=utf-8
from parallels.core.utils.message_utils import single_line_message, load_overrides, multi_line_message

ERROR_PROVISIONING_FAILED_WITH_REASON = single_line_message("""
    Provisioning of subscription to Plesk Multi Server service node failed: {reason}
""")
ERROR_PROVISIONING_FAILED_WITHOUT_REASON = single_line_message("""
    Provisioning of subscription to Plesk Multi Server service node failed
""")
ERROR_PROVISIONING_FAILED_BLOCKED_TASK = single_line_message("""
    Provisioning of subscription to Plesk Multi Server failed: one or more tasks get blocked.
    For more details, check "Tasks" page of Plesk Multi Server management node.
""")
ERROR_PROVISIONING_HANGED = single_line_message("""
    Provisioning of subscription to Plesk Multi Server service node has not finished
    in {time} seconds and is considered hanged
""")
DEBUG_PROVISIONING_FAILED = single_line_message("""
    Provisioning to Plesk Multi Server: the following tasks failed - {tasks}
""")
DEBUG_PROVISIONING_BLOCKED = single_line_message("""
    Provisioning to Plesk Multi Server: the following tasks blocked - {tasks}
""")
DEBUG_PROVISIONING_FINISHED = single_line_message("""
    Provisioning to Plesk Multi Server: finished
""")
DEBUG_PROVISIONING_IN_PROGRESS = single_line_message("""
    Provisioning to Plesk Multi Server: in progress
""")
RESELLERS_NOT_SUPPORTED = single_line_message("""
    Internal error: migrator tried to perform operation on reseller, while resellers are not supported by
    Plesk Multi Server
""")
PLESK_MULTI_SERVER_NODE_DESCRIPTION = single_line_message("""
    Plesk Multi Server Service node '{ip}'
""")
ERROR_FAILED_TO_GET_SUBSCRIPTION_ID_BY_NAME = single_line_message("""
    Failed to get ID of subscription '{subscription}' by its name
""")
ERROR_FAILED_TO_GET_NODE_ID = single_line_message("""
    Failed to get service node ID for subscription '{subscription}'
""")
ERROR_FAILED_TO_GET_NODE_INFO = single_line_message("""
    Failed to get information about service node '{node_id}' for subscription '{subscription}'
""")
DEBUG_NODE_IP_FOR_SUBSCRIPTION = single_line_message("""
    Node IP for subscription '{subscription_name}': {node_ip}
""")
DEBUG_NODE_ID_FOR_SUBSCRIPTION = single_line_message("""
    Node ID for subscription '{subscription_name}': {node_id}
""")
ACTION_CONVERT_IPS_AND_NODES_DESCRIPTION = single_line_message("""
    Convert IP addresses and service nodes to which subscription should be provisioned
""")
ACTION_CONVERT_IPS_AND_NODES_FAILURE = single_line_message("""
    Failed to convert IP addresses and service nodes to which subscription should be provisioned
""")
ACTION_REMOVE_SERVICE_NODE_SSH_KEYS_DESCRIPTION = single_line_message("""
    Remove SSH keys used to connect to Plesk Multi Server service nodes
""")
ACTION_REMOVE_SERVICE_NODE_SSH_KEYS_FAILURE = single_line_message("""
    Failed to remove SSH keys used to connect to Plesk Multi Server service nodes
""")
FAILED_TO_REMOVE_SSH_KEY = single_line_message("""
    Failed to remove SSH key for service node {node_ip}: {reason}.
""")
FAILED_TO_CLEAN_UP_VIRTUAL_HOST = multi_line_message("""
    Failed to remove 'httpdocs' directory created by default virtual host template after subscription creation.
    The subscription could contain some garbage files, which could make site broken after migration.
    If the site does not work correctly after migration, make sure "index.html" created by virtual host template 
    does not conflict with subscription's default page (e.g. index.php).

    Reason: {reason}
""")
FAILED_TO_READ_SERVICE_NODE_SSH_PORT = single_line_message("""
    Failed to read port of service node: not a valid integer value "{port}"
""")

# Load language and UI type overrides. That must be the last line of root messages file.
load_overrides(__name__, locals())
