RIFT-14562
[osm/SO.git] / rwlaunchpad / test / launchpad.py
index 8036792..324b94b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 
-# 
+#
 #   Copyright 2016 RIFT.IO Inc
 #
 #   Licensed under the Apache License, Version 2.0 (the "License");
@@ -472,8 +472,9 @@ def main(argv=sys.argv[1:]):
 
 
     cleanup_dir_name = None
-    if os.environ["INSTALLDIR"] in ["/", "/home/rift", "/home/rift/.install"]:
-        cleanup_dir_name = os.environ["INSTALLDIR"] + "/"
+    if os.environ["INSTALLDIR"] in ["/", "/home/rift", "/home/rift/.install",
+        "/usr/rift/build/fc20_debug/install/usr/rift", "/usr/rift"]:
+        cleanup_dir_name = os.environ["INSTALLDIR"] + "/var/rift/"
 
     if args.test_name and not cleanup_dir_name:
         cleanup_dir_name = "find {rift_install}/var/rift -name '*{pattern}*' -type d".format( \
@@ -486,7 +487,8 @@ def main(argv=sys.argv[1:]):
             print ("Directory not found exception occurred. Probably running for first time")
             print ("Zookeper cleanup cmd = {}".format(cleanup_dir_name))
     else:
-        cleanup_dir_name = os.environ["INSTALLDIR"] + "/"
+        if not cleanup_dir_name:
+          cleanup_dir_name = os.environ["INSTALLDIR"] + "/"
 
     # Remove the persistent Redis data
     try:
@@ -518,10 +520,8 @@ def main(argv=sys.argv[1:]):
               netconf_trace_override=True)
 
     confd_ip = socket.gethostbyname(socket.gethostname())
-    intf = netifaces.ifaddresses('eth0')
-    if intf and netifaces.AF_INET in intf and len(intf[netifaces.AF_INET]):
-       confd_ip = intf[netifaces.AF_INET][0]['addr']
-    rift.vcs.logger.configure_sink(config_file=None, confd_ip=confd_ip)
+    # TODO: This need to be changed when launchpad starts running on multiple VMs
+    rift.vcs.logger.configure_sink(config_file=None, confd_ip="127.0.0.1")
 
     # Start the prepared system
     system.start()