Ejemplo n.º 1
0
    def handle(self, *args, **options):
        projects = Repository.objects.all().values_list('name',flat=True)
        for project in projects:
        	for contenttype in ("jobs","objectstore"):
	        	Datasource.objects.get_or_create(
                    contenttype=contenttype,
                    dataset=1,
                    project=project,
                    host=options['host'],
                    read_only_host=options['readonly_host']
                )
        Datasource.reset_cache()
Ejemplo n.º 2
0
    def handle(self, *args, **options):
        if options["reset"]:
            confirm = input("""You have requested an init of the datasources.
This will IRREVERSIBLY DESTROY all data in the per-project databases.
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: """)
            if confirm == "yes":
                for ds in Datasource.objects.all():
                    ds.delete()

        projects = Repository.objects.filter(active_status='active').values_list('name', flat=True)
        for project in projects:
            Datasource.objects.get_or_create(project=project)
        Datasource.reset_cache()
Ejemplo n.º 3
0
    def handle(self, *args, **options):
        if options["reset"]:
            confirm = input("""You have requested an init of the datasources.
This will IRREVERSIBLY DESTROY all data in the per-project databases.
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: """)
            if confirm == "yes":
                for ds in Datasource.objects.all():
                    ds.delete()

        projects = Repository.objects.filter(
            active_status='active').values_list('name', flat=True)
        for project in projects:
            Datasource.objects.get_or_create(project=project)
        Datasource.reset_cache()
Ejemplo n.º 4
0
    def handle(self, *args, **options):
        if options["reset"]:
            confirm = input("""You have requested an init of the datasources.
This will IRREVERSIBLY DESTROY all data in the jobs and objectstore databases.
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: """)
            if confirm == "yes":
                for ds in Datasource.objects.all():
                    ds.delete()

        projects = Repository.objects.filter(
            active_status='active').values_list('name', flat=True)
        for project in projects:
            for contenttype in ("jobs", "objectstore"):
                Datasource.objects.get_or_create(
                    contenttype=contenttype,
                    project=project,
                    host=options['host'],
                    read_only_host=options['readonly_host'])
        Datasource.reset_cache()
Ejemplo n.º 5
0
    def handle(self, *args, **options):
        if options["reset"]:
            confirm = input("""You have requested an init of the datasources.
This will IRREVERSIBLY DESTROY all data in the jobs and objectstore databases.
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: """)
            if confirm == "yes":
                for ds in Datasource.objects.all():
                    ds.delete()

        projects = Repository.objects.filter(active_status='active').values_list('name', flat=True)
        for project in projects:
            for contenttype in ("jobs", "objectstore"):
                Datasource.objects.get_or_create(
                    contenttype=contenttype,
                    project=project,
                    host=options['host'],
                    read_only_host=options['readonly_host']
                )
        Datasource.reset_cache()