Skip to content

--bucket command line argument not accepted #47

@mgdaily

Description

@mgdaily

Providing the --bucket command line arg to ocs_ingest_frame results in an error, this is because The upload_file_and_ingest_to_archive function no longer accepts the bucket name as a parameter. The bucket should be set in the environment variable, and the documentation should be updated.

def upload_file_and_ingest_to_archive(fileobj, path=None, file_metadata=None,

(banzai-floyds) cmccully@obiwanlcogtn standards % ocs_ingest_frame --help
ERROR:root:ConnectionError(MaxRetryError("HTTPConnectionPool(host='scheduler-dev.lco.gtn', port=80): Max retries exceeded with url: /api/version (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x102731240>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))"))
usage: ocs_ingest_frame [-h] [--api-root API_ROOT] [--auth-token AUTH_TOKEN] [--bucket BUCKET] [--process-name PROCESS_NAME] [--check-only] path

Upload a FITS file to the science archive of an observatory control system. This script will output the resulting URL if the upload is successful. An optional flag --check-only can be used to check for the existence of a file without uploading it (based on
md5).

positional arguments:
  path                  Path to file

options:
  -h, --help            show this help message and exit
  --api-root API_ROOT   API root
  --auth-token AUTH_TOKEN
                        API token
  --bucket BUCKET       S3 bucket name
  --process-name PROCESS_NAME
                        Tag set in collected metrics
  --check-only          Only check if the frame exists in the archive. returns a status code of 0 if found, 1 if not (or an error occurred)
(banzai-floyds) cmccully@obiwanlcogtn standards % ocs_ingest_frame --api-root=https://archive-api.lco.global/ --bucket=archive-lco-global --auth-token=5d8eb61831779a0c1648db90daa2060326e2f01c ./gd108.fits 
ERROR:root:ConnectionError(MaxRetryError("HTTPConnectionPool(host='scheduler-dev.lco.gtn', port=80): Max retries exceeded with url: /api/version (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x1024352a0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))"))
Exception uploading file: upload_file_and_ingest_to_archive() got an unexpected keyword argument 'bucket'%                                                                                                                                                            (banzai-floyds) cmccully@obiwanlcogtn standards % which ocs_ingest_frame
/Users/cmccully/miniconda3/envs/banzai-floyds/bin/ocs_ingest_frame

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions