Commit 64524833 authored by Duggan, John's avatar Duggan, John
Browse files

Ignore Galaxy keys if not submitting through Galaxy

parent 842b9d2b
Loading
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -22,8 +22,8 @@ class IPSFastranTool(BasicTool):
        super().__init__()
        self.model = model

        connection = Connection(galaxy_url, galaxy_api_key).connect()
        self.store = connection.get_data_store("ips_fastran")
        self.galaxy_url = galaxy_url
        self.galaxy_api_key = galaxy_api_key

    def prepare_tool(self) -> Tuple[Tool, Parameters]:
        match self.model.resource_params.run_location:
@@ -37,6 +37,9 @@ class IPSFastranTool(BasicTool):
        return None, None

    def prepare_galaxy(self) -> Tuple[Tool, Parameters]:
        connection = Connection(self.galaxy_url, self.galaxy_api_key).connect()
        self.store = connection.get_data_store("ips_fastran")

        # Prepare file ingestion into Galaxy
        self.inputs_dataset = Dataset(name="inputs.zip")
        with zipfile.ZipFile("input.zip", "w") as zip_obj:
+2 −2
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@ def parse_args() -> Tuple[str, str]:
    parser.add_argument("--galaxy-url", help="URL of the Galaxy server")
    parser.add_argument("--galaxy-key", help="API key for accessing the Galaxy server")
    args, unknown = parser.parse_known_args()
    galaxy_url = args.galaxy_url or os.getenv("GALAXY_URL")
    galaxy_api_key = args.galaxy_key or os.getenv("GALAXY_API_KEY")
    galaxy_url = args.galaxy_url or os.getenv("GALAXY_URL", "")
    galaxy_api_key = args.galaxy_key or os.getenv("GALAXY_API_KEY", "")
    return str(galaxy_url), str(galaxy_api_key)