|
|
|
@ -42,8 +42,8 @@ have the following options:
|
|
|
|
|
case the next network causes Mitter to crash or something related.) A value |
|
|
|
|
of 0 means the Network Manager will save the config file after each round of |
|
|
|
|
requests to all networks (failing or succeding); for devices that use flash |
|
|
|
|
drives as storage, it's recommended some large value (since those devices |
|
|
|
|
have a defined number of writes as lifetime.) Default is '5'. |
|
|
|
|
drives as storage, it's recommended some large value (since those storage |
|
|
|
|
devices have a lifetime based on the number of writes.) Default is '5'. |
|
|
|
|
""" |
|
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------- |
|
|
|
@ -140,7 +140,7 @@ class Networks(object):
|
|
|
|
|
def _save(self): |
|
|
|
|
"""Check the number of operations and, if it above the minimum value, |
|
|
|
|
save the config file.""" |
|
|
|
|
max_count = self._options['Network_Manager']['save_count'] |
|
|
|
|
max_count = self._options['NetworkManager']['save_count'] |
|
|
|
|
_log.debug('Operations %d, max %d', self._operations, max_count) |
|
|
|
|
if self._operations > max_count: |
|
|
|
|
self._options.save() |
|
|
|
@ -167,17 +167,17 @@ class Networks(object):
|
|
|
|
|
conn.options(self._options) |
|
|
|
|
|
|
|
|
|
# add Networks own options |
|
|
|
|
self._options.add_group('Network_Manager', 'Network Manager') |
|
|
|
|
self._options.add_group('NetworkManager', 'Network Manager') |
|
|
|
|
self._options.add_option( |
|
|
|
|
'--timeout', |
|
|
|
|
group='Network_Manager', |
|
|
|
|
group='NetworkManager', |
|
|
|
|
option='timeout', |
|
|
|
|
help='Timeout for requests in all networks.', |
|
|
|
|
type='int', |
|
|
|
|
metavar='SECONDS', |
|
|
|
|
default=120) |
|
|
|
|
self._options.add_option( |
|
|
|
|
group='Network_Manager', |
|
|
|
|
group='NetworkManager', |
|
|
|
|
option='save_count', |
|
|
|
|
help='Number of network operations till the config file ' \ |
|
|
|
|
'is saved', |
|
|
|
|