Github user xunzhang commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/955#discussion_r85680290
--- Diff: tools/bin/hawqregister ---
@@ -939,10 +1082,41 @@ def main(options, args):
failure_handler = FailureHandler(conn)
# register
- ins = HawqRegister(options, args[0], utility_conn, conn,
failure_handler)
+ if options.yml_config and ispartition(options.yml_config):
+ ins = HawqRegisterPartition(options, args[0], utility_conn, conn,
failure_handler)
+ else:
+ ins = HawqRegister(options, args[0], utility_conn, conn,
failure_handler)
+ ins.prepare()
ins.register()
conn.close()
+def test():
+ def connectdb(options):
+ '''
+ Trying to connect database, return a connection object.
+ If failed to connect, raise a pg.InternalError
+ '''
+ url = dbconn.DbURL(hostname=options.host, port=options.port,
+ dbname=options.database, username=options.user)
+ logger.info('try to connect database %s:%s %s' % (url.pghost,
url.pgport, url.pgdb))
+ utility_conn = pg.connect(dbname=url.pgdb, host=url.pghost,
port=url.pgport,
+ user=url.pguser, passwd=url.pgpass,
opt='-c gp_session_role=utility')
+ conn = pg.connect(dbname=url.pgdb, host=url.pghost,
port=url.pgport,
+ user=url.pguser, passwd=url.pgpass)
+ return utility_conn, conn
+
+ # connect db
+ try:
+ utility_conn, conn = connectdb(options)
--- End diff --
where is `options` define, your test function has 0-parameter. Have you
ever tried your `test` function locally?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---