netorconf module

netorconf._backup_filename(new_netor_home_directory, filename)

Create a backup of the specified configuration file

Parameters:
  • new_netor_home_directory – it is the actual new Neto home directory to be updated on files
  • filename – file name to backup
Returns:

nothing

netorconf._create_master_config_file(new_netor_home_directory, filename)

Create new Salt master configuration file.

Parameters:
  • new_netor_home_directory – it is the actual new Neto home directory to be updated on files
  • filename – filename to backup
Returns:

nothing

netorconf._create_minion_config_file(new_netor_home_directory, filename)

Create Salt minion configuration file.

Parameters:
  • new_netor_home_directory – Location where the file will be located
  • filename – file name
Returns:

nothing

netorconf._create_proxy_config_file(new_netor_home_directory, filename)

Create Salt proxy configuration file.

Parameters:
  • new_netor_home_directory – Location where the file will be located
  • filename – file name
Returns:

netorconf._create_update_master_minion_proxy(new_netor_home_directory, filename)

Update or create (if do not exists) Salt configuration files.

Parameters:
  • new_netor_home_directory – it is the actual new Neto home directory to used in the process
  • filename – file name to update
Returns:

nothing

netorconf._file_create_redirect(new_netor_home_directory, filename)

Create the configuration files.

Parameters:
  • new_netor_home_directory – it is the actual new Neto home directory where to create the file
  • filename – file name to create
Returns:

nothing

netorconf._file_update_redirect(new_netor_home_directory, filename)

Update the configuration files.

Parameters:
  • new_netor_home_directory – Directory where the files are located
  • filename – file name to update
Returns:

nothing

netorconf._netor_config()

It is used for updating the Neto home directory in the configuration files and scripts.

This is useful, if you want to have 2 working installations of Neto in completely independent directories.

It will update the NETOR_HOME_DIRECTORY variable in the netor.conf file, and also in the following Neto python scripts which then works with the TinyDB: # netor/tinydb/scripts/listdb.py # netor/tinydb/scripts/pushcustdb.py # netor/tinydb/scripts/worker.py # netor/tinydb/scripts/switchdb.py

Later it will also update the hosts_file variable in the following bash scripts: # bin/netor-ping # bin/netor-traceroute

Returns:nothing
netorconf._update_ansible(netor_home_directory)

Update Ansible configuration files.

Parameters:netor_home_directory – Neto home directory to used for updating the configuration files
Returns:nothing
netorconf._update_config(tinydb_log_file, __file__, new_netor_home_directory)

Execute the actual updates in the files. Salt master, minion and proxy.

Parameters:
  • tinydb_log_file – the filename to send the logging message after the operation is completed
  • __file__ – script name who is sending the message to log
  • new_netor_home_directory – it is the actual new Neto home directory to be updated on files
Returns:

nothing

netorconf._update_master_config_file(new_netor_home_directory, filename)

Update Salt master configuration file.

Parameters:
  • new_netor_home_directory – Location where the file is located
  • filename – file name
Returns:

nothing

netorconf._update_minion_config_file(new_netor_home_directory, filename)

Update Salt minion configuration file.

Parameters:
  • new_netor_home_directory – Location where the file is located
  • filename – file name
Returns:

netorconf._update_proxy_config_file(new_netor_home_directory, filename)

Update Salt proxy configuration file.

Parameters:
  • new_netor_home_directory – Directory where the file is located
  • filename – file name
Returns:

netorconf.check_netor_config(netor_home_directory)

Verifies if the netor.config file exists in the file tree.

Parameters:netor_home_directory – to verify if the netor home directory and file exists
Returns:nothing
netorconf.replace_static_vars_scripts(filename, search, replace, delimiter, extra)

Replace line by line the NETOR_HOME_DIRECTORY static variable in scripts.

Parameters:
  • filename – filename to review
  • search – search pattern to look for
  • replace – patter to replace
  • delimiter – to add a delimiter surrounding the path names
  • extra – add extra path information
Returns:

nothing