nagios-plugin-mongodb
nagios-plugin-mongodb copied to clipboard
Suggestiuon: Unwind the action choices to improve merging
When seeing a new pull request that has a feature that I'd like to put in, invariably the action choice will get edited in such a way that merging via git is not possible. If we changed the choices to a line by line variable, then merging will work no matter what additional checks you have in a custom version, e.g. change:
p.add_option('-A', '--action', action='store', type='choice', dest='action', default='connect', help='The action you want to take',
choices=['connect', 'connections', 'replication_lag', 'replication_lag_percent', 'replset_state', 'memory', 'memory_mapped', 'lock',
'flushing', 'last_flush_time', 'index_miss_ratio', 'databases', 'collections', 'database_size', 'database_indexes', 'collection_indexes', 'collection_size','database_utilization',
'collection_storageSize', 'queues', 'oplog', 'journal_commits_in_wl', 'write_data_files', 'journaled', 'opcounters', 'current_lock', 'replica_primary',
'page_faults', 'asserts', 'queries_per_second', 'page_faults', 'chunks_balance', 'connect_primary', 'collection_state', 'row_count', 'replset_quorum'])
to
p.add_option('-A', '--action', action='store', type='choice', dest='action', default='connect', help='The action you want to take',
choices=['connect',
'connections',
'replication_lag',
...
'memory',
'row_count',
'replset_quorum'
])
Then when a new check is added, it won't nerf any changes that were made by hand.