Ver código fonte

AMBARI-4845. Remove test code from component script files in stack
definition (aonishuk)

Andrew Onischuk 11 anos atrás
pai
commit
0a1cf22d12
21 arquivos alterados com 14 adições e 215 exclusões
  1. 1 10
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/package/scripts/hbase_client.py
  2. 1 11
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/package/scripts/hbase_master.py
  3. 1 9
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/package/scripts/hbase_regionserver.py
  4. 2 10
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/package/scripts/service_check.py
  5. 2 11
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/nagios_server.py
  6. 1 10
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie_client.py
  7. 1 10
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie_server.py
  8. 1 11
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/service_check.py
  9. 0 10
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/package/scripts/pig_client.py
  10. 0 12
      ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/package/scripts/service_check.py
  11. 1 10
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_client.py
  12. 1 11
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_master.py
  13. 1 9
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_regionserver.py
  14. 0 9
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/service_check.py
  15. 1 11
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/nagios_server.py
  16. 0 10
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_client.py
  17. 0 10
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_server.py
  18. 0 10
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/service_check.py
  19. 0 10
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/package/scripts/pig_client.py
  20. 0 12
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/package/scripts/service_check.py
  21. 0 9
      ambari-server/src/main/resources/stacks/HDP/2.1.1/services/TEZ/package/scripts/tez_client.py

+ 1 - 10
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/package/scripts/hbase_client.py

@@ -38,15 +38,6 @@ class HbaseClient(Script):
   def status(self, env):
     raise ClientComponentHasNoStatus()
 
-#for tests
-def main():
-  command_type = 'install'
-  command_data_file = '/root/workspace/HBase/input.json'
-  basedir = '/root/workspace/HBase/'
-  stdoutfile = '/1.txt'
-  sys.argv = ["", command_type, command_data_file, basedir, stdoutfile]
-  
-  HbaseClient().execute()
-  
+
 if __name__ == "__main__":
   HbaseClient().execute()

+ 1 - 11
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/package/scripts/hbase_master.py

@@ -65,16 +65,6 @@ class HbaseMaster(Script):
 
     hbase_decommission(env)
 
-def main():
-  command_type = sys.argv[1] if len(sys.argv)>1 else "install"
-  print "Running "+command_type
-  command_data_file = '/var/lib/ambari-agent/data/command-3.json'
-  basedir = '/root/ambari/ambari-server/src/main/resources/stacks/HDP/2.0._/services/HBASE/package'
-  stroutputf = '/1.txt'
-  sys.argv = ["", command_type, command_data_file, basedir, stroutputf]
-  
-  HbaseMaster().execute()
-  
+
 if __name__ == "__main__":
   HbaseMaster().execute()
-  #main()

+ 1 - 9
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/package/scripts/hbase_regionserver.py

@@ -61,14 +61,6 @@ class HbaseRegionServer(Script):
   def decommission(self, env):
     print "Decommission not yet implemented!"
     
-def main():
-  command_type = sys.argv[1] if len(sys.argv)>1 else "stop"
-  print "Running "+command_type
-  command_data_file = '/root/workspace/HBase/input.json'
-  basedir = '/root/workspace/HBase/main'
-  sys.argv = ["", command_type, command_data_file, basedir]
-  
-  HbaseRegionServer().execute()
-  
+
 if __name__ == "__main__":
   HbaseRegionServer().execute()

+ 2 - 10
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/package/scripts/service_check.py

@@ -73,16 +73,8 @@ class HbaseServiceCheck(Script):
       user = params.smoke_test_user,
       logoutput = True
     )
-    
-def main():
-  import sys
-  command_type = 'perform'
-  command_data_file = '/root/workspace/HBase/input.json'
-  basedir = '/root/workspace/HBase/main'
-  sys.argv = ["", command_type, command_data_file, basedir]
-  
-  HbaseServiceCheck().execute()
-  
+
+
 if __name__ == "__main__":
   HbaseServiceCheck().execute()
   

+ 2 - 11
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/nagios_server.py

@@ -97,16 +97,7 @@ def update_ignorable(params):
     finally:
       if f is not None:
         f.close()
-def main():
-  command_type = sys.argv[1] if len(sys.argv)>1 else "install"
-  print "Running "+command_type
-  command_data_file = '/var/lib/ambari-agent/data/command-3.json'
-  basedir = '/root/ambari/ambari-server/src/main/resources/stacks/HDP/2.0._/services/NAGIOS/package'
-  stroutfile = '/1.txt'
-  sys.argv = ["", command_type, command_data_file, basedir, stroutfile]
-  
-  NagiosServer().execute()
-  
+
+
 if __name__ == "__main__":
-  #main()
   NagiosServer().execute()

+ 1 - 10
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie_client.py

@@ -39,15 +39,6 @@ class OozieClient(Script):
   def status(self, env):
     raise ClientComponentHasNoStatus()
     
-def main():
-  command_type = sys.argv[1] if len(sys.argv)>1 else "install"
-  print "Running "+command_type
-  command_data_file = '/root/workspace/Oozie/input.json'
-  basedir = '/root/workspace/Oozie/main'
-  sys.argv = ["", command_type, command_data_file, basedir]
-  
-  OozieClient().execute()
-  
+
 if __name__ == "__main__":
-  #main()
   OozieClient().execute()

+ 1 - 10
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie_server.py

@@ -51,15 +51,6 @@ class OozieServer(Script):
     env.set_params(status_params)
     check_process_status(status_params.pid_file)
     
-def main():
-  command_type = sys.argv[1] if len(sys.argv)>1 else "start"
-  print "Running "+command_type
-  command_data_file = '/root/workspace/Oozie/input.json'
-  basedir = '/root/workspace/Oozie/main'
-  sys.argv = ["", command_type, command_data_file, basedir]
-  
-  OozieServer().execute()
-  
+
 if __name__ == "__main__":
-  #main()
   OozieServer().execute()

+ 1 - 11
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/service_check.py

@@ -31,17 +31,7 @@ def oozie_smoke_shell_file(
     try_sleep = 5,
     logoutput = True
   )
-    
-def main():
-  import sys
-  command_type = 'service_check'
-  command_data_file = '/root/workspace/Oozie/input.json'
-  basedir = '/root/workspace/Oozie/main'
-  sys.argv = ["", command_type, command_data_file, basedir]
-  
-  OozieServiceCheck().execute()
-  
+
 if __name__ == "__main__":
   OozieServiceCheck().execute()
-  #main()
   

+ 0 - 10
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/package/scripts/pig_client.py

@@ -38,15 +38,5 @@ class PigClient(Script):
   def status(self, env):
     raise ClientComponentHasNoStatus()
     
-#for tests
-def main():
-  command_type = 'install'
-  command_data_file = '/root/workspace/Pig/input.json'
-  basedir = '/root/workspace/Pig/main'
-  sys.argv = ["", command_type, command_data_file, basedir]
-  
-  PigClient().execute()
-  
 if __name__ == "__main__":
-  #main()
   PigClient().execute()

+ 0 - 12
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/PIG/package/scripts/service_check.py

@@ -64,18 +64,6 @@ class PigServiceCheck(Script):
       conf_dir = params.hadoop_conf_dir
     )
     
-def main():
-  command_type = "service_check"
-  print "Running "+command_type
-  command_data_file = '/var/lib/ambari-agent/data/command-2.json'
-  basedir = '/root/ambari/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/package'
-  stroutfile = '/1.txt'
-  import sys
-  sys.argv = ["", command_type, command_data_file, basedir, stroutfile]
-  
-  PigServiceCheck().execute()
-  
 if __name__ == "__main__":
-  #main()
   PigServiceCheck().execute()
   

+ 1 - 10
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_client.py

@@ -38,15 +38,6 @@ class HbaseClient(Script):
   def status(self, env):
     raise ClientComponentHasNoStatus()
 
-#for tests
-def main():
-  command_type = 'install'
-  command_data_file = '/root/workspace/HBase/input.json'
-  basedir = '/root/workspace/HBase/'
-  stdoutfile = '/1.txt'
-  sys.argv = ["", command_type, command_data_file, basedir, stdoutfile]
-  
-  HbaseClient().execute()
-  
+
 if __name__ == "__main__":
   HbaseClient().execute()

+ 1 - 11
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_master.py

@@ -65,16 +65,6 @@ class HbaseMaster(Script):
 
     hbase_decommission(env)
 
-def main():
-  command_type = sys.argv[1] if len(sys.argv)>1 else "install"
-  print "Running "+command_type
-  command_data_file = '/var/lib/ambari-agent/data/command-3.json'
-  basedir = '/root/ambari/ambari-server/src/main/resources/stacks/HDP/2.0._/services/HBASE/package'
-  stroutputf = '/1.txt'
-  sys.argv = ["", command_type, command_data_file, basedir, stroutputf]
-  
-  HbaseMaster().execute()
-  
+
 if __name__ == "__main__":
   HbaseMaster().execute()
-  #main()

+ 1 - 9
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_regionserver.py

@@ -61,14 +61,6 @@ class HbaseRegionServer(Script):
   def decommission(self, env):
     print "Decommission not yet implemented!"
     
-def main():
-  command_type = sys.argv[1] if len(sys.argv)>1 else "stop"
-  print "Running "+command_type
-  command_data_file = '/root/workspace/HBase/input.json'
-  basedir = '/root/workspace/HBase/main'
-  sys.argv = ["", command_type, command_data_file, basedir]
-  
-  HbaseRegionServer().execute()
-  
+
 if __name__ == "__main__":
   HbaseRegionServer().execute()

+ 0 - 9
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/service_check.py

@@ -74,15 +74,6 @@ class HbaseServiceCheck(Script):
       logoutput = True
     )
     
-def main():
-  import sys
-  command_type = 'perform'
-  command_data_file = '/root/workspace/HBase/input.json'
-  basedir = '/root/workspace/HBase/main'
-  sys.argv = ["", command_type, command_data_file, basedir]
-  
-  HbaseServiceCheck().execute()
-  
 if __name__ == "__main__":
   HbaseServiceCheck().execute()
   

+ 1 - 11
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/nagios_server.py

@@ -98,16 +98,6 @@ def update_ignorable(params):
       if f is not None:
         f.close()
 
-def main():
-  command_type = sys.argv[1] if len(sys.argv)>1 else "install"
-  print "Running "+command_type
-  command_data_file = '/var/lib/ambari-agent/data/command-3.json'
-  basedir = '/root/ambari/ambari-server/src/main/resources/stacks/HDP/2.0._/services/NAGIOS/package'
-  stroutfile = '/1.txt'
-  sys.argv = ["", command_type, command_data_file, basedir, stroutfile]
-  
-  NagiosServer().execute()
-  
+
 if __name__ == "__main__":
-  #main()
   NagiosServer().execute()

+ 0 - 10
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_client.py

@@ -19,15 +19,5 @@ class OozieClient(Script):
   def status(self, env):
     raise ClientComponentHasNoStatus()
     
-def main():
-  command_type = sys.argv[1] if len(sys.argv)>1 else "install"
-  print "Running "+command_type
-  command_data_file = '/root/workspace/Oozie/input.json'
-  basedir = '/root/workspace/Oozie/main'
-  sys.argv = ["", command_type, command_data_file, basedir]
-  
-  OozieClient().execute()
-  
 if __name__ == "__main__":
-  #main()
   OozieClient().execute()

+ 0 - 10
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_server.py

@@ -32,15 +32,5 @@ class OozieServer(Script):
     env.set_params(status_params)
     check_process_status(status_params.pid_file)
     
-def main():
-  command_type = sys.argv[1] if len(sys.argv)>1 else "start"
-  print "Running "+command_type
-  command_data_file = '/root/workspace/Oozie/input.json'
-  basedir = '/root/workspace/Oozie/main'
-  sys.argv = ["", command_type, command_data_file, basedir]
-  
-  OozieServer().execute()
-  
 if __name__ == "__main__":
-  #main()
   OozieServer().execute()

+ 0 - 10
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/service_check.py

@@ -52,16 +52,6 @@ def oozie_smoke_shell_file(
     logoutput = True
   )
     
-def main():
-  import sys
-  command_type = 'service_check'
-  command_data_file = '/root/workspace/Oozie/input.json'
-  basedir = '/root/workspace/Oozie/main'
-  sys.argv = ["", command_type, command_data_file, basedir]
-  
-  OozieServiceCheck().execute()
-  
 if __name__ == "__main__":
   OozieServiceCheck().execute()
-  #main()
   

+ 0 - 10
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/package/scripts/pig_client.py

@@ -38,15 +38,5 @@ class PigClient(Script):
   def status(self, env):
     raise ClientComponentHasNoStatus()
     
-#for tests
-def main():
-  command_type = 'install'
-  command_data_file = '/root/workspace/Pig/input.json'
-  basedir = '/root/workspace/Pig/main'
-  sys.argv = ["", command_type, command_data_file, basedir]
-  
-  PigClient().execute()
-  
 if __name__ == "__main__":
-  #main()
   PigClient().execute()

+ 0 - 12
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/package/scripts/service_check.py

@@ -64,18 +64,6 @@ class PigServiceCheck(Script):
       conf_dir = params.hadoop_conf_dir
     )
     
-def main():
-  command_type = "service_check"
-  print "Running "+command_type
-  command_data_file = '/var/lib/ambari-agent/data/command-2.json'
-  basedir = '/root/ambari/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/package'
-  stroutfile = '/1.txt'
-  import sys
-  sys.argv = ["", command_type, command_data_file, basedir, stroutfile]
-  
-  PigServiceCheck().execute()
-  
 if __name__ == "__main__":
-  #main()
   PigServiceCheck().execute()
   

+ 0 - 9
ambari-server/src/main/resources/stacks/HDP/2.1.1/services/TEZ/package/scripts/tez_client.py

@@ -37,15 +37,6 @@ class TezClient(Script):
   def status(self, env):
     raise ClientComponentHasNoStatus()
 
-#for tests
-def main():
-  command_type = 'install'
-  command_data_file = '/root/workspace/Pig/input.json'
-  basedir = '/root/workspace/Pig/main'
-  sys.argv = ["", command_type, command_data_file, basedir]
-
-  TezClient().execute()
 
 if __name__ == "__main__":
-  #main()
   TezClient().execute()