diff options
Diffstat (limited to 'rpmbuild-remote.py')
-rw-r--r-- | rpmbuild-remote.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/rpmbuild-remote.py b/rpmbuild-remote.py index 6142861..49afeb3 100644 --- a/rpmbuild-remote.py +++ b/rpmbuild-remote.py @@ -88,7 +88,22 @@ def read_preferences(options): ('host', 'str'), ('port', 'int'), ) - system = {} + config = ConfigParser.SafeConfigParser() + config.read(options.config) + system = read_section(config, options.system, values) + if system == {}: + system = read_section(config, 'default', values) + if 'user' not in system: + system['user'] = options.user + if 'ssh_key' not in system: + system['ssh_key'] = options.ssh_key + if 'host' not in system: + if options.host is None: + LOG.error("Host not set") + sys.exit(1) + system['host'] = options.host + if 'port' not in system: + system['port'] = options.port return system def main(): |