X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetstack%2Fhpc_observer%2Fsteps%2Fsync_contentprovider.py;h=b3c2f66492bbef0336006404a2bbc3171598a371;hb=972db1ffcae67b46a19c7eb5d53fecff9f67606f;hp=cebe1869264592b7cfa60c38d321841376b0fcbb;hpb=90156a6ec84c6fb778494a38134627d3dba21c69;p=plstackapi.git diff --git a/planetstack/hpc_observer/steps/sync_contentprovider.py b/planetstack/hpc_observer/steps/sync_contentprovider.py index cebe186..b3c2f66 100644 --- a/planetstack/hpc_observer/steps/sync_contentprovider.py +++ b/planetstack/hpc_observer/steps/sync_contentprovider.py @@ -25,11 +25,14 @@ class SyncContentProvider(SyncStep, HpcLibrary): HpcLibrary.__init__(self) def fetch_pending(self, deleted): - self.sanity_check() + #self.consistency_check() return SyncStep.fetch_pending(self, deleted) - def sanity_check(self): + def consistency_check(self): + # set to true if something changed + result=False + # sanity check to make sure our PS objects have CMI objects behind them all_cp_ids = [x["content_provider_id"] for x in self.client.onev.ListAll("ContentProvider")] for cp in ContentProvider.objects.all(): @@ -37,11 +40,13 @@ class SyncContentProvider(SyncStep, HpcLibrary): logger.info("Content provider %s was not found on CMI" % cp.content_provider_id) cp.content_provider_id=None cp.save() + result = True + + return result def sync_record(self, cp): logger.info("sync'ing content provider %s" % str(cp)) account_name = self.make_account_name(cp.name) - print "XXX", cp.name, account_name if (not cp.serviceProvider) or (not cp.serviceProvider.service_provider_id): return