diff --git a/cf_remote/main.py b/cf_remote/main.py index d97f016..127e45b 100644 --- a/cf_remote/main.py +++ b/cf_remote/main.py @@ -1,6 +1,7 @@ import argparse import os import sys +import re from cf_remote import log from cf_remote import version @@ -504,7 +505,7 @@ def validate_command(command, args): if command in ["sudo", "run"]: if len(args.remote_command) != 1: raise CFRExitError( - "cf-remote sude/run requires exactly 1 command (use quotes)" + "cf-remote sudo/run requires exactly 1 command (use quotes)" ) args.remote_command = args.remote_command[0] @@ -627,8 +628,10 @@ def resolve_hosts(string, single=False, bootstrap_ips=False): hosts = get_cloud_hosts(name, bootstrap_ips) ret.extend(hosts) log.debug("found in cloud, adding '{}'".format(hosts)) - else: + elif name == "localhost" or re.search(r"[@:.]", name): ret.append(name) + else: + raise CFRUserError("'{}' does not exist.".format(name)) if single: if len(ret) != 1: