You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spot.apache.org by ev...@apache.org on 2017/03/29 16:51:43 UTC

[19/50] [abbrv] incubator-spot git commit: Include parent packages in oa moudle

Include parent packages in oa moudle


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

Branch: refs/heads/SPOT-35_graphql_api
Commit: b165f5eecb2073bad1020a8f7ac32f8e825a6eb1
Parents: 3386849
Author: Everardo Lopez Sandoval (Intel) <el...@elopezsa-mac02.local>
Authored: Tue Mar 7 09:50:22 2017 -0600
Committer: Diego Ortiz Huerta <di...@intel.com>
Committed: Wed Mar 15 11:49:48 2017 -0700

----------------------------------------------------------------------
 spot-oa/oa/start_oa.py | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spot/blob/b165f5ee/spot-oa/oa/start_oa.py
----------------------------------------------------------------------
diff --git a/spot-oa/oa/start_oa.py b/spot-oa/oa/start_oa.py
index b604aab..660814f 100644
--- a/spot-oa/oa/start_oa.py
+++ b/spot-oa/oa/start_oa.py
@@ -20,6 +20,7 @@
 import argparse
 import os
 import sys
+sys.path.append("../")
 import logging
 
 from utils import Util
@@ -39,43 +40,43 @@ def main():
     start_oa(args)
 
 def start_oa(args):
-    
-    # setup the main logger for all the OA process.    
+
+    # setup the main logger for all the OA process.
     logger = Util.get_logger('OA',create_file=False)
 
-    logger.info("-------------------- STARTING OA ---------------------")   
-    validate_parameters_values(args,logger)   
+    logger.info("-------------------- STARTING OA ---------------------")
+    validate_parameters_values(args,logger)
 
     # create data type instance.
     module = __import__("{0}.{0}_oa".format(args.type),fromlist=['OA'])
-   
-    # start OA.   
+
+    # start OA.
     oa_process = module.OA(args.date,args.limit,logger)
     oa_process.start()
-  
+
 def validate_parameters_values(args,logger):
-    
+
     logger.info("Validating input parameter values")
 
     #date.
-    is_date_ok = True if len(args.date) == 8 else False    
+    is_date_ok = True if len(args.date) == 8 else False
 
     # type
     dirs = os.walk(script_path).next()[1]
     is_type_ok = True if args.type in dirs else False
-   
-    #limit    
+
+    #limit
     try:
         int(args.limit)
         is_limit_ok = True
     except ValueError:
         is_limit_ok = False
-      
-    if not is_date_ok: logger.error("date parameter is not correct, please validate it") 
+
+    if not is_date_ok: logger.error("date parameter is not correct, please validate it")
     if not is_type_ok: logger.error("type parameter is not supported, please select a valid type")
     if not is_limit_ok: logger.error("limit parameter is not correct, please select a valid limit")
     if not is_date_ok or not is_type_ok or not is_limit_ok: sys.exit(1)
-   
+
 
 if __name__=='__main__':
-    main()
\ No newline at end of file
+    main()