Riccardo,
I think there might still be a bug, however it might be caused by this new update. I pulled in the latest commit, and it seems to be reading the config file entry from ~/.ssh/config now. However, I think there is a type conversion issue when reading in the string from ~/.ssh/config. I tried to track it down myself, but it’s late and I got a bit lost =). Here is the traceback (note this happens for IPs and FQDNs, I’ve swapped all the ones in the traceback with placeholders for privacy reasons):
gservers: [2017-03-29 21:28:57] INFO : Starting gservers at Wed Mar 29 21:28:57 2017; invoked as '/Users/Kyle/gc3pie/bin/gservers -vv'
gservers: [2017-03-29 21:28:57] DEBUG : Configuration.load(): File '/etc/gc3/gc3pie.conf' does not exist, ignoring.
gservers: [2017-03-29 21:28:57] DEBUG : Configuration.load(): File '/Users/Kyle/gc3pie/etc/gc3/gc3pie.conf' does not exist, ignoring.
gservers: [2017-03-29 21:28:57] DEBUG : Configuration.merge_file(): Reading file '/Users/Kyle/.gc3/gc3pie.conf' ...
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Read configuration stanza for auth 'none'
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Read configuration stanza for auth 'workstations'
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Read configuration stanza for resource 'localhost'.
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Resource 'localhost' defined by: architecture=set(['x86_64']), auth='none', enabled=True, max_cores=4, max_cores_per_job=4, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(4, unit=hour), name='localhost', override='true', transport='local', type='shellcmd'.
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Read configuration stanza for resource 'dell'.
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Resource 'dell' defined by: architecture=set(['x86_64']), auth='workstations', enabled=True, frontend='dell', max_cores=4, max_cores_per_job=4, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(48, unit=hour), name='dell', override='true', ssh_config='~/.ssh/config', transport='ssh', type='shellcmd'.
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Read configuration stanza for resource 'lenovo'.
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Resource 'lenovo' defined by: architecture=set(['x86_64']), auth='workstations', enabled=True, frontend='lenovo', max_cores=6, max_cores_per_job=6, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(48, unit=hour), name='lenovo', override='true', ssh_config='~/.ssh/config', transport='ssh', type='shellcmd'.
gservers: [2017-03-29 21:28:57] DEBUG : Creating resource 'lenovo' defined by: architecture=set(['x86_64']), auth='workstations', enabled=True, frontend='lenovo', max_cores=6, max_cores_per_job=6, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(48, unit=hour), name='lenovo', override='true', ssh_config='~/.ssh/config', transport='ssh', type='shellcmd'.
gservers: [2017-03-29 21:28:57] DEBUG : Using class <class 'gc3libs.backends.shellcmd.ShellcmdLrms'> from module <module 'gc3libs.backends.shellcmd' from '/Users/Kyle/gc3pie/src/gc3libs/backends/shellcmd.pyc'> to instanciate resources of type shellcmd
gservers: [2017-03-29 21:28:57] INFO : Computational resource 'lenovo' initialized successfully.
gservers: [2017-03-29 21:28:57] DEBUG : Creating resource 'dell' defined by: architecture=set(['x86_64']), auth='workstations', enabled=True, frontend='dell', max_cores=4, max_cores_per_job=4, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(48, unit=hour), name='dell', override='true', ssh_config='~/.ssh/config', transport='ssh', type='shellcmd'.
gservers: [2017-03-29 21:28:57] INFO : Computational resource 'dell' initialized successfully.
gservers: [2017-03-29 21:28:57] DEBUG : Creating resource 'localhost' defined by: architecture=set(['x86_64']), auth='none', enabled=True, max_cores=4, max_cores_per_job=4, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(4, unit=hour), name='localhost', override='true', transport='local', type='shellcmd'.
gservers: [2017-03-29 21:28:57] INFO : Computational resource 'localhost' initialized successfully.
gservers: [2017-03-29 21:28:57] DEBUG : Opening SshTransport...
gservers: [2017-03-29 21:28:58] DEBUG : Using no ProxyCommand for SSH connections.
gservers: [2017-03-29 21:28:58] DEBUG : Connecting to host ‘
BLAHBLAH.something.org' (port 22) as user ‘A_PERSON' via SSH (timeout 30s)...
gservers: [2017-03-29 21:28:59] ERROR : Could not create ssh connection to
BLAHBLAH.something.org: TypeError: %d format: a number is required, not str
gservers: [2017-03-29 21:28:59] ERROR : Ignoring error updating resource 'lenovo': Failed connecting to remote host '
BLAHBLAH.something.org': %d format: a number is required, not str.
gservers: [2017-03-29 21:28:59] DEBUG : Got error 'TransportError' in updating resource 'lenovo'; printing full traceback.
Traceback (most recent call last):
File "/Users/Kyle/gc3pie/src/gc3libs/core.py", line 831, in update_resources
lrms.get_resource_status()
File "/Users/Kyle/gc3pie/src/gc3libs/backends/shellcmd.py", line 700, in get_resource_status
self._gather_machine_specs()
File "/Users/Kyle/gc3pie/src/gc3libs/backends/shellcmd.py", line 499, in _gather_machine_specs
self.transport.connect()
File "/Users/Kyle/gc3pie/src/gc3libs/backends/transport.py", line 626, in connect
.format(hostname=self.remote_frontend, msg=ex))
TransportError: Failed connecting to remote host '
BLAHBLAH.something.org': %d format: a number is required, not str
gservers: [2017-03-29 21:28:59] DEBUG : Opening SshTransport...
gservers: [2017-03-29 21:28:59] DEBUG : Using no ProxyCommand for SSH connections.
gservers: [2017-03-29 21:28:59] DEBUG : Connecting to host '1.2.3.4' (port 22) as user 'A_PERSON' via SSH (timeout 30s)...
gservers: [2017-03-29 21:29:00] ERROR : Could not create ssh connection to
1.2.3.4: TypeError: %d format: a number is required, not str
gservers: [2017-03-29 21:29:00] ERROR : Ignoring error updating resource 'dell': Failed connecting to remote host '1.2.3.4': %d format: a number is required, not str.
gservers: [2017-03-29 21:29:00] DEBUG : Got error 'TransportError' in updating resource 'dell'; printing full traceback.
Traceback (most recent call last):
File "/Users/Kyle/gc3pie/src/gc3libs/core.py", line 831, in update_resources
lrms.get_resource_status()
File "/Users/Kyle/gc3pie/src/gc3libs/backends/shellcmd.py", line 700, in get_resource_status
self._gather_machine_specs()
File "/Users/Kyle/gc3pie/src/gc3libs/backends/shellcmd.py", line 499, in _gather_machine_specs
self.transport.connect()
File "/Users/Kyle/gc3pie/src/gc3libs/backends/transport.py", line 626, in connect
.format(hostname=self.remote_frontend, msg=ex))
TransportError: Failed connecting to remote host '1.2.3.4': %d format: a number is required, not str
gservers: [2017-03-29 21:29:00] DEBUG : Opening LocalTransport...
gservers: [2017-03-29 21:29:00] DEBUG : Executed local command 'echo "$HOME/.gc3/shellcmd.d"', got exit status: 0
gservers: [2017-03-29 21:29:00] DEBUG : Executed local command 'uname -m', got exit status: 0
gservers: [2017-03-29 21:29:00] DEBUG : Executed local command 'uname -s', got exit status: 0
gservers: [2017-03-29 21:29:00] DEBUG : Checking if GNU time is available as command `time`
gservers: [2017-03-29 21:29:00] DEBUG : Executed local command 'command time --version 2>&1 | grep GNU', got exit status: 0
gservers: [2017-03-29 21:29:00] DEBUG : Executed local command 'sysctl hw.ncpu', got exit status: 0
gservers: [2017-03-29 21:29:00] DEBUG : Executed local command 'sysctl hw.memsize', got exit status: 0
gservers: [2017-03-29 21:29:00] INFO : Mismatch of value `max_cores` on resource 'localhost': configuration file says `max_cores=4` while it's actually `8`. Updating current value.
gservers: [2017-03-29 21:29:00] INFO : Mismatch of value `max_memory_per_core` on resource localhost: configuration file says `max_memory_per_core=4GB` while it's actually `17179MB`. Updating current value.