From 67a1bc198b4c369c9b95746e0d4f0fd39cf9cbbc Mon Sep 17 00:00:00 2001 From: Kevin_Zheng Date: Wed, 29 Apr 2015 15:03:23 +0800 Subject: [PATCH] Fix a series of typos There are some typos in the source codes Change-Id: Id31deb19a277340cbf4d66111c55582e0879bdb5 --- compute-clone-neat.py | 2 +- compute-copy-conf.py | 2 +- compute-data-collector-start.py | 2 +- compute-data-collector-status.py | 2 +- compute-data-collector-stop.py | 2 +- compute-install-deps.py | 2 +- compute-install-neat.py | 2 +- compute-local-manager-start.py | 2 +- compute-local-manager-status.py | 2 +- compute-local-manager-stop.py | 2 +- compute-sync-time.py | 2 +- neat/config.py | 2 +- neat/globals/db_cleaner.py | 2 +- neat/globals/manager.py | 4 ++-- neat/locals/collector.py | 2 +- neat/locals/manager.py | 2 +- tests/globals/test_db_cleaner.py | 2 +- tests/globals/test_manager.py | 2 +- tests/locals/test_collector.py | 2 +- tests/locals/test_manager.py | 2 +- tests/test_config.py | 6 +++--- vm-placement.py | 2 +- 22 files changed, 25 insertions(+), 25 deletions(-) diff --git a/compute-clone-neat.py b/compute-clone-neat.py index e28aad7..8315ee1 100755 --- a/compute-clone-neat.py +++ b/compute-clone-neat.py @@ -17,7 +17,7 @@ from neat.config import * import neat.common as common -config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], +config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) compute_hosts = common.parse_compute_hosts(config['compute_hosts']) diff --git a/compute-copy-conf.py b/compute-copy-conf.py index 4091731..a3c332b 100755 --- a/compute-copy-conf.py +++ b/compute-copy-conf.py @@ -20,7 +20,7 @@ from neat.config import * import neat.common as common -config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], +config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) compute_hosts = common.parse_compute_hosts(config['compute_hosts']) diff --git a/compute-data-collector-start.py b/compute-data-collector-start.py index 98c14ae..959c8f6 100755 --- a/compute-data-collector-start.py +++ b/compute-data-collector-start.py @@ -17,7 +17,7 @@ from neat.config import * import neat.common as common -config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], +config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) compute_hosts = common.parse_compute_hosts(config['compute_hosts']) diff --git a/compute-data-collector-status.py b/compute-data-collector-status.py index a17abbe..95bf6c8 100755 --- a/compute-data-collector-status.py +++ b/compute-data-collector-status.py @@ -17,7 +17,7 @@ from neat.config import * import neat.common as common -config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], +config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) compute_hosts = common.parse_compute_hosts(config['compute_hosts']) diff --git a/compute-data-collector-stop.py b/compute-data-collector-stop.py index 83a4770..346cc0e 100755 --- a/compute-data-collector-stop.py +++ b/compute-data-collector-stop.py @@ -17,7 +17,7 @@ from neat.config import * import neat.common as common -config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], +config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) compute_hosts = common.parse_compute_hosts(config['compute_hosts']) diff --git a/compute-install-deps.py b/compute-install-deps.py index c6f97bf..881cf66 100755 --- a/compute-install-deps.py +++ b/compute-install-deps.py @@ -17,7 +17,7 @@ from neat.config import * import neat.common as common -config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], +config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) compute_hosts = common.parse_compute_hosts(config['compute_hosts']) diff --git a/compute-install-neat.py b/compute-install-neat.py index 1e67bd5..b54dbe5 100755 --- a/compute-install-neat.py +++ b/compute-install-neat.py @@ -17,7 +17,7 @@ from neat.config import * import neat.common as common -config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], +config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) compute_hosts = common.parse_compute_hosts(config['compute_hosts']) diff --git a/compute-local-manager-start.py b/compute-local-manager-start.py index b82fa87..bd03aaf 100755 --- a/compute-local-manager-start.py +++ b/compute-local-manager-start.py @@ -17,7 +17,7 @@ from neat.config import * import neat.common as common -config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], +config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) compute_hosts = common.parse_compute_hosts(config['compute_hosts']) diff --git a/compute-local-manager-status.py b/compute-local-manager-status.py index e6ae6a9..00823cb 100755 --- a/compute-local-manager-status.py +++ b/compute-local-manager-status.py @@ -17,7 +17,7 @@ from neat.config import * import neat.common as common -config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], +config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) compute_hosts = common.parse_compute_hosts(config['compute_hosts']) diff --git a/compute-local-manager-stop.py b/compute-local-manager-stop.py index 4fe96c4..ec7ca0c 100755 --- a/compute-local-manager-stop.py +++ b/compute-local-manager-stop.py @@ -17,7 +17,7 @@ from neat.config import * import neat.common as common -config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], +config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) compute_hosts = common.parse_compute_hosts(config['compute_hosts']) diff --git a/compute-sync-time.py b/compute-sync-time.py index 0b4a72b..b99996d 100755 --- a/compute-sync-time.py +++ b/compute-sync-time.py @@ -17,7 +17,7 @@ from neat.config import * import neat.common as common -config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], +config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) compute_hosts = common.parse_compute_hosts(config['compute_hosts']) diff --git a/neat/config.py b/neat/config.py index f352d78..4a92444 100644 --- a/neat/config.py +++ b/neat/config.py @@ -25,7 +25,7 @@ log = logging.getLogger(__name__) # This is the default config, which should not be modified -DEFAILT_CONFIG_PATH = os.path.join(os.path.dirname(__file__), +DEFAULT_CONFIG_PATH = os.path.join(os.path.dirname(__file__), '..', 'neat.conf') diff --git a/neat/globals/db_cleaner.py b/neat/globals/db_cleaner.py index a43d260..f6cb55a 100644 --- a/neat/globals/db_cleaner.py +++ b/neat/globals/db_cleaner.py @@ -40,7 +40,7 @@ def start(): :return: The final state. :rtype: dict(str: *) """ - config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], + config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) common.init_logging( diff --git a/neat/globals/manager.py b/neat/globals/manager.py index 44af1d2..40ff6c5 100644 --- a/neat/globals/manager.py +++ b/neat/globals/manager.py @@ -107,7 +107,7 @@ ERRORS = { @contract def raise_error(status_code): - """ Raise and HTTPResponse exception with the specified status code. + """ Raise an HTTPResponse exception with the specified status code. :param status_code: An HTTP status code of the error. :type status_code: int @@ -163,7 +163,7 @@ def validate_params(user, password, params): def start(): """ Start the global manager web service. """ - config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], + config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) common.init_logging( diff --git a/neat/locals/collector.py b/neat/locals/collector.py index 9e640d1..45c8587 100644 --- a/neat/locals/collector.py +++ b/neat/locals/collector.py @@ -114,7 +114,7 @@ def start(): :return: The final state. :rtype: dict(str: *) """ - config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], + config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) common.init_logging( diff --git a/neat/locals/manager.py b/neat/locals/manager.py index 1cbb71f..6e6d4a9 100644 --- a/neat/locals/manager.py +++ b/neat/locals/manager.py @@ -123,7 +123,7 @@ def start(): :return: The final state. :rtype: dict(str: *) """ - config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], + config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) common.init_logging( diff --git a/tests/globals/test_db_cleaner.py b/tests/globals/test_db_cleaner.py index 0c7cb0d..bc72dc1 100644 --- a/tests/globals/test_db_cleaner.py +++ b/tests/globals/test_db_cleaner.py @@ -38,7 +38,7 @@ class DbCleaner(TestCase): 'log_directory': 'dir', 'log_level': 2, 'db_cleaner_interval': str(time_interval)} - paths = [cleaner.DEFAILT_CONFIG_PATH, cleaner.CONFIG_PATH] + paths = [cleaner.DEFAULT_CONFIG_PATH, cleaner.CONFIG_PATH] fields = cleaner.REQUIRED_FIELDS expect(cleaner).read_and_validate_config(paths, fields). \ and_return(config).once() diff --git a/tests/globals/test_manager.py b/tests/globals/test_manager.py index 0264c6e..27d26bc 100644 --- a/tests/globals/test_manager.py +++ b/tests/globals/test_manager.py @@ -170,7 +170,7 @@ class GlobalManager(TestCase): 'global_manager_host': 'localhost', 'global_manager_port': 8080, 'ether_wake_interface': 'eth0'} - paths = [manager.DEFAILT_CONFIG_PATH, manager.CONFIG_PATH] + paths = [manager.DEFAULT_CONFIG_PATH, manager.CONFIG_PATH] fields = manager.REQUIRED_FIELDS expect(manager).read_and_validate_config(paths, fields). \ and_return(config).once() diff --git a/tests/locals/test_collector.py b/tests/locals/test_collector.py index f2ec90b..3118ecd 100644 --- a/tests/locals/test_collector.py +++ b/tests/locals/test_collector.py @@ -41,7 +41,7 @@ class Collector(TestCase): 'log_level': 2, 'local_data_directory': 'data_dir', 'data_collector_interval': str(time_interval)} - paths = [collector.DEFAILT_CONFIG_PATH, collector.CONFIG_PATH] + paths = [collector.DEFAULT_CONFIG_PATH, collector.CONFIG_PATH] fields = collector.REQUIRED_FIELDS expect(collector).read_and_validate_config(paths, fields). \ and_return(config).once() diff --git a/tests/locals/test_manager.py b/tests/locals/test_manager.py index c877fbb..2c861f9 100644 --- a/tests/locals/test_manager.py +++ b/tests/locals/test_manager.py @@ -40,7 +40,7 @@ class LocalManager(TestCase): 'log_directory': 'dir', 'log_level': 2, 'local_manager_interval': str(time_interval)} - paths = [manager.DEFAILT_CONFIG_PATH, manager.CONFIG_PATH] + paths = [manager.DEFAULT_CONFIG_PATH, manager.CONFIG_PATH] fields = manager.REQUIRED_FIELDS expect(manager).read_and_validate_config(paths, fields). \ and_return(config).once() diff --git a/tests/test_config.py b/tests/test_config.py index 98858e3..8b49c69 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -25,13 +25,13 @@ class Config(TestCase): @qc def read_default_config(): - paths = [config.DEFAILT_CONFIG_PATH] + paths = [config.DEFAULT_CONFIG_PATH] test_config = config.read_config(paths) assert config.validate_config(test_config, config.REQUIRED_FIELDS) @qc def read_config(): - paths = [config.DEFAILT_CONFIG_PATH, config.CONFIG_PATH] + paths = [config.DEFAULT_CONFIG_PATH, config.CONFIG_PATH] test_config = config.read_config(paths) assert config.validate_config(test_config, config.REQUIRED_FIELDS) @@ -75,7 +75,7 @@ class Config(TestCase): ): with MockTransaction: test_config = dict(zip(x, x)) - paths = [config.DEFAILT_CONFIG_PATH, config.CONFIG_PATH] + paths = [config.DEFAULT_CONFIG_PATH, config.CONFIG_PATH] expect(config).read_config(paths).and_return(test_config).once() expect(config).validate_config(test_config, y). \ and_return(False).once() diff --git a/vm-placement.py b/vm-placement.py index 443ed0a..c747a5f 100755 --- a/vm-placement.py +++ b/vm-placement.py @@ -25,7 +25,7 @@ def vm_hostname(vm): return str(getattr(vm, 'OS-EXT-SRV-ATTR:host')) -config = read_and_validate_config([DEFAILT_CONFIG_PATH, CONFIG_PATH], +config = read_and_validate_config([DEFAULT_CONFIG_PATH, CONFIG_PATH], REQUIRED_FIELDS) db = manager.init_db(config['sql_connection']) nova = client.Client(config['os_admin_user'],