Example #1
0
 def refresh(self):
     """Refresh location info."""
     # check if a refresh is already in progress
     if threadMgr.get(constants.THREAD_GEOLOCATION_REFRESH):
         log.debug("Geoloc: refresh already in progress")
     else:  # wait for Internet connectivity
         if network.wait_for_connectivity():
             threadMgr.add(
                 AnacondaThread(name=constants.THREAD_GEOLOCATION_REFRESH,
                                target=self._provider.refresh))
         else:
             log.error("Geolocation refresh failed" " - no connectivity")
Example #2
0
 def refresh(self):
     """Refresh location info."""
     # check if a refresh is already in progress
     if threadMgr.get(constants.THREAD_GEOLOCATION_REFRESH):
         log.debug("Geoloc: refresh already in progress")
     else:  # wait for Internet connectivity
         if network.wait_for_connectivity():
             threadMgr.add(AnacondaThread(
                 name=constants.THREAD_GEOLOCATION_REFRESH,
                 target=self._provider.refresh))
         else:
             log.error("Geolocation refresh failed"
                       " - no connectivity")
Example #3
0
    def startServer(self):
        self.log.info(_("Starting VNC..."))
        network.wait_for_connectivity()

        # Lets call it from here for now.
        try:
            self.initialize()
        except (socket.herror, dbus.DBusException, ValueError) as e:
            stdoutLog.critical("Could not initialize the VNC server: %s", e)
            iutil.ipmi_abort(scripts=self.anaconda.ksdata.scripts)
            sys.exit(1)

        if self.password and (len(self.password) < 6 or len(self.password) > 8):
            self.changeVNCPasswdWindow()

        if not self.password:
            SecurityTypes = "None"
            rfbauth = "0"
        else:
            SecurityTypes = "VncAuth"
            rfbauth = self.pw_file
            # Create the password file.
            self.setVNCPassword()

        # Lets start the xvnc.
        xvnccommand = [XVNC_BINARY_NAME, ":%s" % constants.X_DISPLAY_NUMBER,
                       "-depth", "16", "-br",
                       "IdleTimeout=0", "-auth", "/dev/null", "-once",
                       "DisconnectClients=false", "desktop=%s" % (self.desktop,),
                       "SecurityTypes=%s" % SecurityTypes, "rfbauth=%s" % rfbauth]

        try:
            iutil.startX(xvnccommand, output_redirect=self.openlogfile())
        except OSError:
            stdoutLog.critical("Could not start the VNC server.  Aborting.")
            iutil.ipmi_abort(scripts=self.anaconda.ksdata.scripts)
            sys.exit(1)

        self.log.info(_("The VNC server is now running."))

        # Lets tell the user what we are going to do.
        if self.vncconnecthost != "":
            self.log.warning(_("\n\nYou chose to connect to a listening vncviewer. \n"
                                "This does not require a password to be set.  If you \n"
                                "set a password, it will be used in case the connection \n"
                                "to the vncviewer is unsuccessful\n\n"))
        elif self.password == "":
            self.log.warning(_("\n\nWARNING!!! VNC server running with NO PASSWORD!\n"
                                "You can use the vncpassword=<password> boot option\n"
                                "if you would like to secure the server.\n\n"))
        elif self.password != "":
            self.log.warning(_("\n\nYou chose to execute vnc with a password. \n\n"))
        else:
            self.log.warning(_("\n\nUnknown Error.  Aborting. \n\n"))
            iutil.ipmi_abort(scripts=self.anaconda.ksdata.scripts)
            sys.exit(1)

        # Lets try to configure the vnc server to whatever the user specified
        if self.vncconnecthost != "":
            connected = self.connectToView()
            if not connected:
                self.VNCListen()
        else:
            self.VNCListen()

        # Start vncconfig for copy/paste
        self.startVncConfig()
Example #4
0
    def startServer(self):
        self.log.info(_("Starting VNC..."))
        network.wait_for_connectivity()

        # Lets call it from here for now.
        try:
            self.initialize()
        except (socket.herror, dbus.DBusException, ValueError) as e:
            stdoutLog.critical("Could not initialize the VNC server: %s", e)
            util.ipmi_abort(scripts=self.anaconda.ksdata.scripts)
            sys.exit(1)

        if self.password and (len(self.password) < 6
                              or len(self.password) > 8):
            self.changeVNCPasswdWindow()

        if not self.password:
            SecurityTypes = "None"
            rfbauth = "0"
        else:
            SecurityTypes = "VncAuth"
            rfbauth = self.pw_file
            # Create the password file.
            self.setVNCPassword()

        # Lets start the xvnc.
        xvnccommand = [
            XVNC_BINARY_NAME,
            ":%s" % constants.X_DISPLAY_NUMBER, "-depth", "16", "-br",
            "IdleTimeout=0", "-auth", "/dev/null", "-once",
            "DisconnectClients=false",
            "desktop=%s" % (self.desktop, ),
            "SecurityTypes=%s" % SecurityTypes,
            "rfbauth=%s" % rfbauth
        ]

        try:
            util.startX(xvnccommand,
                        output_redirect=self.openlogfile(),
                        timeout=self.timeout)
        except OSError:
            stdoutLog.critical("Could not start the VNC server.  Aborting.")
            util.ipmi_abort(scripts=self.anaconda.ksdata.scripts)
            sys.exit(1)

        self.log.info(_("The VNC server is now running."))

        # Lets tell the user what we are going to do.
        if self.vncconnecthost != "":
            self.log.warning(
                _("\n\nYou chose to connect to a listening vncviewer. \n"
                  "This does not require a password to be set.  If you \n"
                  "set a password, it will be used in case the connection \n"
                  "to the vncviewer is unsuccessful\n\n"))
        elif self.password == "":
            self.log.warning(
                _("\n\nWARNING!!! VNC server running with NO PASSWORD!\n"
                  "You can use the vncpassword=PASSWORD boot option\n"
                  "if you would like to secure the server.\n\n"))
        elif self.password != "":
            self.log.warning(
                _("\n\nYou chose to execute vnc with a password. \n\n"))
        else:
            self.log.warning(_("\n\nUnknown Error.  Aborting. \n\n"))
            util.ipmi_abort(scripts=self.anaconda.ksdata.scripts)
            sys.exit(1)

        # Lets try to configure the vnc server to whatever the user specified
        if self.vncconnecthost != "":
            connected = self.connectToView()
            if not connected:
                self.VNCListen()
        else:
            self.VNCListen()

        # Start vncconfig for copy/paste
        self.startVncConfig()
Example #5
0
    def startServer(self):
        self.log.info(_("Starting VNC..."))
        network.wait_for_connectivity()

        # Lets call it from here for now.
        try:
            self.initialize()
        except (socket.herror, dbus.DBusException, ValueError) as e:
            stdoutLog.critical("Could not initialize the VNC server: %s", e)
            sys.exit(1)

        if self.password and (len(self.password) < 6
                              or len(self.password) > 8):
            self.changeVNCPasswdWindow()

        if not self.password:
            SecurityTypes = "None"
            rfbauth = "0"
        else:
            SecurityTypes = "VncAuth"
            rfbauth = self.pw_file
            # Create the password file.
            self.setVNCPassword()

        # Lets start the xvnc.
        xvnccommand = [
            XVNC_BINARY_NAME,
            ":%s" % self.display, "-depth", "16", "-br", "IdleTimeout=0",
            "-auth", "/dev/null", "-once", "DisconnectClients=false",
            "desktop=%s" % (self.desktop, ),
            "SecurityTypes=%s" % SecurityTypes,
            "rfbauth=%s" % rfbauth
        ]

        try:
            xvncp = subprocess.Popen(xvnccommand,
                                     stdout=self.openlogfile(),
                                     stderr=subprocess.STDOUT)
        except OSError:
            stdoutLog.critical("Could not start the VNC server.  Aborting.")
            sys.exit(1)

        # Lets give the xvnc time to initialize
        time.sleep(1)

        # Make sure it hasn't blown up
        if xvncp.poll() != None:
            sys.exit(1)
        else:
            self.log.info(_("The VNC server is now running."))

        # Lets tell the user what we are going to do.
        if self.vncconnecthost != "":
            self.log.warning(
                _("\n\nYou chose to connect to a listening vncviewer. \n"
                  "This does not require a password to be set.  If you \n"
                  "set a password, it will be used in case the connection \n"
                  "to the vncviewer is unsuccessful\n\n"))
        elif self.password == "":
            self.log.warning(
                _("\n\nWARNING!!! VNC server running with NO PASSWORD!\n"
                  "You can use the vncpassword=<password> boot option\n"
                  "if you would like to secure the server.\n\n"))
        elif self.password != "":
            self.log.warning(
                _("\n\nYou chose to execute vnc with a password. \n\n"))
        else:
            self.log.warning(_("\n\nUnknown Error.  Aborting. \n\n"))
            sys.exit(1)

        # Lets try to configure the vnc server to whatever the user specified
        if self.vncconnecthost != "":
            connected = self.connectToView()
            if not connected:
                self.VNCListen()
        else:
            self.VNCListen()

        os.environ["DISPLAY"] = ":%s" % self.display
Example #6
0
    def startServer(self):
        self.log.info(_("Starting VNC..."))
        network.wait_for_connectivity()

        # Lets call it from here for now.
        try:
            self.initialize()
        except (socket.herror, dbus.DBusException, ValueError) as e:
            stdoutLog.critical("Could not initialize the VNC server: %s", e)
            sys.exit(1)

        if self.password and (len(self.password) < 6 or len(self.password) > 8):
            self.changeVNCPasswdWindow()

        if not self.password:
            SecurityTypes = "None"
            rfbauth = "0"
        else:
            SecurityTypes = "VncAuth"
            rfbauth = self.pw_file
            # Create the password file.
            self.setVNCPassword()

        # Lets start the xvnc.
        xvnccommand =  [ XVNC_BINARY_NAME, ":%s" % self.display,
                        "-depth", "16", "-br",
                        "IdleTimeout=0", "-auth", "/dev/null", "-once",
                        "DisconnectClients=false", "desktop=%s" % (self.desktop,),
                        "SecurityTypes=%s" % SecurityTypes, "rfbauth=%s" % rfbauth ]

        try:
            xvncp = subprocess.Popen(xvnccommand, stdout=self.openlogfile(), stderr=subprocess.STDOUT)
        except OSError:
            stdoutLog.critical("Could not start the VNC server.  Aborting.")
            sys.exit(1)

        # Lets give the xvnc time to initialize
        time.sleep(1)

        # Make sure it hasn't blown up
        if xvncp.poll() != None:
            sys.exit(1)
        else:
            self.log.info(_("The VNC server is now running."))

        # Lets tell the user what we are going to do.
        if self.vncconnecthost != "":
            self.log.warning(_("\n\nYou chose to connect to a listening vncviewer. \n"
                                "This does not require a password to be set.  If you \n"
                                "set a password, it will be used in case the connection \n"
                                "to the vncviewer is unsuccessful\n\n"))
        elif self.password == "":
            self.log.warning(_("\n\nWARNING!!! VNC server running with NO PASSWORD!\n"
                                "You can use the vncpassword=<password> boot option\n"
                                "if you would like to secure the server.\n\n"))
        elif self.password != "":
            self.log.warning(_("\n\nYou chose to execute vnc with a password. \n\n"))
        else:
            self.log.warning(_("\n\nUnknown Error.  Aborting. \n\n"))
            sys.exit(1)

        # Lets try to configure the vnc server to whatever the user specified
        if self.vncconnecthost != "":
            connected = self.connectToView()
            if not connected:
                self.VNCListen()
        else:
            self.VNCListen()

        os.environ["DISPLAY"]=":%s" % self.display