The persistent_links.py file is a Python script to maintain desired persistent links on a Free Star* system. It leverages the configuration files used by the g2_link
program. It is targeted at Python 2.4+, as many of the Free Star* systems are running on Centos 5.x, which ships with Python 2.4.
- Ensure that you have a working version of Python 2 installed (version 2.4+)
- Place persistent_links.py on the system and ensure it is executable
- Edit the script to customize the
G2_LINK_DIRECTORY
,RF_TIMERS
, andADMIN
variables as necessary. - Add a crontab entry to run the script periodically. A sample entry:
*/5 * * * * /root/g2_link/persistent_links.py >> /var/log/persistent_links.log 2>&1
If you would like to run unit tests on the code, these are contained in persistent_link_tests.py
. Follow the following steps:
- Ensure that you have a working version of Python 2 installed (version 2.4+)
- Place
persistent_link_tests.py
on the system in the same directory aspersistent_links.py
and ensure that the former is not executable (nose will not discover tests by default in an executable script). - You must have the packages
mock
andnose
installed for these tests to execute. - Run
nosetests persistent_link_tests.py
If you would like to suggest changes to the script, you may create a ticket associated with it. You may also submit patches using the following process:
- Ensure you have a github account
- Submit a ticket, if one does not already exist
- Fork the repository on Github
- Make your changes
- After ensuring PEP8 compliance, please push to your fork
- Submit a pull request, referencing the ticket associated with it.