Esempio n. 1
0
def create_database():
    u"""Cria a base de dados do nimbus"""
    call_command('syncdb',verbosity=0,interactive=False)
    if len(User.objects.all()) == 0:
        u = User(username = "******",
                 is_superuser=True,
                 is_staff=True,
                 email = "*****@*****.**")
        u.set_password("admin")
        u.save()

        call_command('loaddata', settings.INITIALDATA_FILE)
        # FIX: LOADDATA nao eh invocado em um dpkg update


        config = Config.get_instance()
        config.director_password = utils.random_password()
        config.save()

        storage = Storage.objects.get(id=1)
        storage.password =  utils.random_password()
        storage.save()

        computer = Computer.objects.get(id=1)
        computer.activate()

        register_administrative_nimbus_models()

        call_reload_baculadir()
    else:
        force_unlock_bacula_and_start()
Esempio n. 2
0
def create_database():
    u"""Cria a base de dados do nimbus"""
    call_command('syncdb', verbosity=0, interactive=False)
    if len(User.objects.all()) == 0:
        u = User(username="******",
                 is_superuser=True,
                 is_staff=True,
                 email="*****@*****.**")
        u.set_password("admin")
        u.save()

        call_command('loaddata', settings.INITIALDATA_FILE)
        # FIX: LOADDATA nao eh invocado em um dpkg update

        config = Config.get_instance()
        config.director_password = utils.random_password()
        config.save()

        storage = Storage.objects.get(id=1)
        storage.password = utils.random_password()
        storage.save()

        computer = Computer.objects.get(id=1)
        computer.activate()

        register_administrative_nimbus_models()

        call_reload_baculadir()
    else:
        force_unlock_bacula_and_start()
Esempio n. 3
0
    def create_database(self):
        call_command('syncdb',verbosity=0,interactive=False)
        if len(User.objects.all()) == 0:
            u = User(username = "******",
                     is_superuser=True,
                     email = "*****@*****.**")
            u.set_password("admin")
            u.save()

            call_command('loaddata', settings.INITIALDATA_FILE)


            config = Config.get_instance()
            config.director_password = utils.random_password()
            config.save()

            storage = Storage.objects.get(id=1)
            storage.password =  utils.random_password()
            storage.save()

            computer = Computer.objects.get(id=1)
            computer.activate()

            register_administrative_nimbus_models()

            reload_manager = ReloadManager()
            reload_manager.force_reload()
        else:
            force_unlock_bacula_and_start()
Esempio n. 4
0
    def create_database(self):
        call_command('syncdb', verbosity=0, interactive=False)
        if len(User.objects.all()) == 0:
            u = User(username="******",
                     is_superuser=True,
                     email="*****@*****.**")
            u.set_password("admin")
            u.save()

            call_command('loaddata', settings.INITIALDATA_FILE)

            config = Config.get_instance()
            config.director_password = utils.random_password()
            config.save()

            storage = Storage.objects.get(id=1)
            storage.password = utils.random_password()
            storage.save()

            computer = Computer.objects.get(id=1)
            computer.activate()

            register_administrative_nimbus_models()

            reload_manager = ReloadManager()
            reload_manager.force_reload()
        else:
            force_unlock_bacula_and_start()