Exemplo n.º 1
0
def do_install(file_path):
    try:
        logger.info("Installing from %s" % file_path)
        validate_elixys_is_up()
        possible_username_passwords = copy.deepcopy(PASSCODES)
        possible_username_passwords = decrypt_passcodes(possible_username_passwords)
        updater = Updater(ELIXYS_HOST_IP, Port)
        logger.info("Authenticating into the CBOX")
        updater.get_elixys_connection(possible_username_passwords)
        logger.info("Successfully authenticated")
        try:
            updated = updater.copy_elixys_to_machine(file_path)
            if updated:
                logger.info("You may restart your Elixys machine now")
            else:
                logger.info("Install has been cancelled")
        except Exception as e:
            logger.error("Error: " + str(e))
            logger.error("Failed to update Elixys.\nPlease contact SofieBio Sciences to resolve the problem.")
        finally:
            updater.connection.close()
            updater.ssh_client.close()
    except socket.timeout:
        msg = "Could not validate Elixys connection.\n" + \
              "You are most likely not on the same network.\n" + \
              "Ensure you are connected to the Elixys router.\n" + \
              "If you are connected via WIFI, it might be worth connecting to it via Ethernet.\n" + \
              "If problems continue to persist please contact SofieBio Sciences."
        logger.error(msg)
    except socket.error:
        msg = "Could not validate Elixys connection.\n" + \
              "Is Elixys up and running?\n" + \
              "If you just turned Elixys on please give it time(2 minutes) to boot up before trying this again.\n" + \
              "You can validate the Elixys is up by opening the Elixys app and viewing the login screen.  Please try again once you can see the Elixys app.\n\n" + \
              "If problems continue to persist please contact SofieBio Sciences."
        logger.error(msg)
    except Exception as e:
        logger.error("Error: " + str(e))
        logger.error("Failed to authenticate Elixys.\nPlease contact SofieBio Sciences to resolve the problem")
Exemplo n.º 2
0
def do_authentication(updater):
    possible_username_passwords = copy.deepcopy(PASSCODES)
    possible_username_passwords = decrypt_passcodes(possible_username_passwords)
    updater.get_elixys_connection(possible_username_passwords)