@classmethod
def update_config(cls, config_file, config):
    """ Update configuration if needed. """
    need_save = False
    if 'api' in config and 'env' in config['api']:
        del config['api']['env']
        need_save = True
    ssh_key = config.get('ssh_key')
    sshkeys = config.get('sshkey')
    if ssh_key and not sshkeys:
        config.update({'sshkey': [ssh_key]})
        need_save = True
    elif ssh_key and sshkeys:
        config.update({'sshkey': sshkeys.append(ssh_key)})
        need_save = True
    if ssh_key:
        del config['ssh_key']
        need_save = True
    if need_save:
        cls.save(config_file, config)
