Commits and closes the currently open configration. Saves a step by not needing to manually close the config.

        Example:

        .. code-block:: python

            from pyJunosManager import JunosDevice

            dev = JunosDevice(host="1.2.3.4",username="root",password="Juniper")
            dev.open()
            dev.load_config_template("system{ host-name {{ hostname }};}",hostname="foo")
            dev commit_and_quit()
            dev.close()

def commit_and_quit(self):
        """
        Commits and closes the currently open configration. Saves a step by not needing to manually close the config.

        Example:

        .. code-block:: python

            from pyJunosManager import JunosDevice

            dev = JunosDevice(host="1.2.3.4",username="root",password="Juniper")
            dev.open()
            dev.load_config_template("system{ host-name {{ hostname }};}",hostname="foo")
            dev commit_and_quit()
            dev.close()

        """
        try:
            self.dev.rpc.commit_configuration()
            self.close_config()
        except Exception as err:
            print err