def handle()

in atomresponder/management/commands/run_atom_responder.py [0:0]


    def handle(self, *args, **options):
        from kinesisresponder.sentry import inform_sentry_exception
        import traceback
        import xml.etree.cElementTree as ET
        from gnmvidispine.vs_external_id import ExternalIdNamespace
        from gnmvidispine.vidispine_api import VSNotFound

        #ensure that the namespace for our external IDs is present. If not, create it.
        #this is to make it simple for LaunchDetector to look up items by atom ID
        extid_namespace = ExternalIdNamespace(url=settings.VIDISPINE_URL,user=settings.VIDISPINE_USERNAME,passwd=settings.VIDISPINE_PASSWORD)
        try:
            extid_namespace.populate("atom_uuid")
            logger.info("Found external id namespace atom_uuid")
        except VSNotFound:
            try:
                extid_namespace.create("atom_uuid","[A-Fa-f0-9]{8}\-[A-Fa-f0-9]{4}\-[A-Fa-f0-9]{4}\-[A-Fa-f0-9]{4}\-[A-Fa-f0-9]{12}")
                logger.info("Created new external id namespace atom_uuid")
            except Exception as e:
                logger.error(traceback.format_exc())
                inform_sentry_exception(extra_ctx={'namespace_source': ET.tostring(extid_namespace._xmldoc, encoding="UTF-8")})
                raise

        newoptions = options.copy()
        newoptions.update({
            'aws_access_key_id': settings.MEDIA_ATOM_AWS_ACCESS_KEY_ID,
            'aws_secret_access_key': settings.MEDIA_ATOM_AWS_SECRET_ACCESS_KEY
        })

        super(Command, self).handle(*args,**newoptions)