-def fetch_instances(domain: str):
- print("DEBUG: Fetching instances for domain:", domain)
- peerlist = fba.get_peers(domain)
+def fetch_instances(domain: str, origin: str, software: str, path: str = None):
+ # NOISY-DEBUG: print("DEBUG: domain,origin,software,path:", domain, origin, software, path)
+ if not fba.is_instance_registered(domain):
+ # NOISY-DEBUG: print("DEBUG: Adding new domain:", domain, origin)
+ fba.add_instance(domain, origin, sys.argv[0], path)
+
+ # NOISY-DEBUG: print("DEBUG: Fetching instances for domain:", domain, software)
+ peerlist = fba.get_peers(domain, software)