def get_instances_dir(self, remote_server=None):
    local_instance_path = os.path.normpath(CONF.instances_path)
    if remote_server:
        if CONF.hyperv.instances_path_share:
            path = CONF.hyperv.instances_path_share
        else:
            path = local_instance_path.replace(':', '$')
        return ('\\\\%(remote_server)s\\%(path)s' % {'remote_server': remote_server, 'path': path})
    else:
        return local_instance_path
def get_instances_dir(self, remote_server=None):
    local_instance_path = os.path.normpath(CONF.instances_path)
    if remote_server:
        if CONF.hyperv.instances_path_share:
            path = CONF.hyperv.instances_path_share
        else:
            path = local_instance_path.replace(':', '$')
        return ('\\\\%(remote_server)s\\%(path)s' % {'remote_server': remote_server, 'path': path})
    else:
        return local_instance_path