Beispiel #1
0
def get_nimbus_address():
    from nimbus.config.models import Config  # Ver nota nos imports iniciais

    config = Config.get_instance()
    if not config.director_address:
        return get_raw_network_interface_address()
    return config.director_address
Beispiel #2
0
def get_nimbus_address():
    from nimbus.config.models import Config # Ver nota nos imports iniciais
    
    config = Config.get_instance()
    if not config.director_address:
        return get_raw_network_interface_address()
    return config.director_address
Beispiel #3
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()
Beispiel #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()
Beispiel #5
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()
Beispiel #6
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()
Beispiel #7
0
def update_director_address(interface):
    from nimbus.config.models import Config  # Ver nota nos imports iniciais

    config = Config.get_instance()
    config.director_address = interface.address
    config.save(system_permission=True)
    logger = logging.getLogger(__name__)
    logger.info("Atualizando ip do director")
Beispiel #8
0
 def get_config_file(self):
     config = Config.get_instance()
     return render_to_string("bacula-fd", 
                             director_name=config.director_name,
                             password=self.password,
                             name=self.bacula_name,
                             os=self.operating_systems,
                             nimbus=False)
 def get_config_file(self):
     config = Config.get_instance()
     return render_to_string("bacula-fd",
                             director_name=config.director_name,
                             password=self.password,
                             name=self.bacula_name,
                             os=self.operating_systems,
                             nimbus=False)
Beispiel #10
0
def update_director_address(interface):
    from nimbus.config.models import Config # Ver nota nos imports iniciais
    
    config = Config.get_instance()
    config.director_address = interface.address
    config.save(system_permission=True)
    logger = logging.getLogger(__name__)
    logger.info("Atualizando ip do director")
Beispiel #11
0
 def configure(self):
     nimbuscomputer = Computer.objects.get(id=1)
     url = "http://%s:%d" % (self.address, settings.NIMBUS_CLIENT_PORT)
     proxy = xmlrpclib.ServerProxy(url)
     proxy.save_keys(self.crypto_info.pem,
                     nimbuscomputer.crypto_info.certificate)
     config = Config.get_instance()
     fdconfig = render_to_string("bacula-fd",
                                 director_name=config.director_name,
                                 password=self.password,
                                 name=self.name,
                                 os=self.operation_system)
     proxy.save_config(unicode(fdconfig))
     proxy.restart_bacula()
Beispiel #12
0
 def configure(self):
     nimbuscomputer = Computer.objects.get(id=1)
     url = "http://%s:%d" % (self.address, settings.NIMBUS_CLIENT_PORT)
     socket.setdefaulttimeout(40)
     proxy = xmlrpclib.ServerProxy(url)
     proxy.save_keys(self.crypto_info.pem,
                     nimbuscomputer.crypto_info.certificate)
     config = Config.get_instance()
     fdconfig = render_to_string("bacula-fd",
                                 director_name=config.director_name,
                                 password=self.password,
                                 name=self.name,
                                 os=self.operation_system)
     proxy.save_config(unicode(fdconfig))
     proxy.restart_bacula()