def update_ssh_config(self, path="~/.ssh/config"):
        """Put the DNS into the ssh config file."""
        # Read the config file #
        import sshconf
        config = sshconf.read_ssh_config(os.path.expanduser(path))
        # In case it doesn't exist #
        if not config.host(self.instance_name): config.add(self.instance_name)
        # Add the new DNS #
        config.set(self.instance_name, Hostname=self.dns)
        # Write result #
        config.write(os.path.expanduser(path))
def update_ssh_config ( self , path = "~/.ssh/config" ) : import sshconf config = sshconf . read_ssh_config ( os . path . expanduser ( path ) ) if not config . host ( self . instance_name ) : config . add ( self . instance_name ) config . set ( self . instance_name , Hostname = self . dns ) config . write ( os . path . expanduser ( path ) )
Put the DNS into the ssh config file.