hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hubertzh...@apache.org
Subject incubator-hawq git commit: HAWQ-991. Add try catch for parsing the yaml file.
Date Wed, 28 Sep 2016 03:25:50 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master bc873239e -> 4ddbc249e


HAWQ-991. Add try catch for parsing the yaml file.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/4ddbc249
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/4ddbc249
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/4ddbc249

Branch: refs/heads/master
Commit: 4ddbc249e524c5b4b40ac9cddf6e7562dad74a92
Parents: bc87323
Author: hzhang2 <zhanghuan929@163.com>
Authored: Wed Sep 28 10:27:06 2016 +0800
Committer: hzhang2 <zhanghuan929@163.com>
Committed: Wed Sep 28 10:27:32 2016 +0800

----------------------------------------------------------------------
 tools/bin/hawqregister | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/4ddbc249/tools/bin/hawqregister
----------------------------------------------------------------------
diff --git a/tools/bin/hawqregister b/tools/bin/hawqregister
index 4b7655c..29cd56a 100755
--- a/tools/bin/hawqregister
+++ b/tools/bin/hawqregister
@@ -423,8 +423,14 @@ class HawqRegister(object):
 
         def option_parser_yml(yml_file):
             import yaml
-            with open(yml_file, 'r') as f:
-                params = yaml.load(f)
+            try:
+                with open(yml_file, 'r') as f:
+                    params = yaml.load(f)
+            except yaml.scanner.ScannerError as e:
+                print e
+                self.failure_handler.rollback()
+                sys.exit(1)
+            
             table_column_num = self.accessor.get_table_column_num(self.tablename)
             register_yaml_dict_check(params, table_column_num, self.tablename)
             partitions_filepaths = []


Mime
View raw message