Beispiel #1
0
    def sync_record(self, vs):

        logger.info("Sync VolumeSlice for (%s, %s)" %
                    (vs.volume_id.name, vs.slice_id.name),
                    extra=vs.tologdict())

        # extract arguments...
        user_email = vs.slice_id.creator.email
        slice_name = vs.slice_id.name
        volume_name = vs.volume_id.name
        syndicate_caps = syndicatelib.opencloud_caps_to_syndicate_caps(
            vs.cap_read_data, vs.cap_write_data, vs.cap_host_data)
        RG_port = vs.RG_portnum
        UG_port = vs.UG_portnum
        slice_secret = None

        config = syndicatelib.get_config()
        try:
            observer_secret = config.SYNDICATE_OPENCLOUD_SECRET
            RG_closure = config.SYNDICATE_RG_CLOSURE
            observer_pkey_path = config.SYNDICATE_PRIVATE_KEY
            syndicate_url = config.SYNDICATE_SMI_URL

        except Exception, e:
            traceback.print_exc()
            logger.error(
                "syndicatelib config is missing one or more of the following: SYNDICATE_OPENCLOUD_SECRET, SYNDICATE_RG_CLOSURE, SYNDICATE_PRIVATE_KEY, SYNDICATE_SMI_URL",
                extra=vs.tologdict())
            raise e
Beispiel #2
0
 def sync_record(self, vac):
     
     syndicate_caps = "UNKNOWN"  # for exception handling
     
     # get arguments
     config = syndicatelib.get_config()
     user_email = vac.owner_id.email
     volume_name = vac.volume.name
     syndicate_caps = syndicatelib.opencloud_caps_to_syndicate_caps( vac.cap_read_data, vac.cap_write_data, vac.cap_host_data ) 
     
     logger.info( "Sync VolumeAccessRight for (%s, %s)" % (user_email, volume_name) )
     
     # validate config
     try:
        RG_port = config.SYNDICATE_RG_DEFAULT_PORT
        observer_secret = config.SYNDICATE_OPENCLOUD_SECRET
     except Exception, e:
        traceback.print_exc()
        logger.error("syndicatelib config is missing SYNDICATE_RG_DEFAULT_PORT, SYNDICATE_OPENCLOUD_SECRET")
        raise e
 def sync_record(self, vac):
     
     syndicate_caps = "UNKNOWN"  # for exception handling
     
     # get arguments
     config = syndicatelib.get_config()
     user_email = vac.owner_id.email
     volume_name = vac.volume.name
     syndicate_caps = syndicatelib.opencloud_caps_to_syndicate_caps( vac.cap_read_data, vac.cap_write_data, vac.cap_host_data ) 
     
     logger.info( "Sync VolumeAccessRight for (%s, %s)" % (user_email, volume_name) )
     
     # validate config
     try:
        RG_port = config.SYNDICATE_RG_DEFAULT_PORT
        observer_secret = config.SYNDICATE_OPENCLOUD_SECRET
     except Exception, e:
        traceback.print_exc()
        logger.error("syndicatelib config is missing SYNDICATE_RG_DEFAULT_PORT, SYNDICATE_OPENCLOUD_SECRET")
        raise e
Beispiel #4
0
 def sync_record(self, vs):
     
     logger.info("Sync VolumeSlice for (%s, %s)" % (vs.volume_id.name, vs.slice_id.name),extra=vs.tologdict())
     
     # extract arguments...
     user_email = vs.slice_id.creator.email
     slice_name = vs.slice_id.name
     volume_name = vs.volume_id.name
     syndicate_caps = syndicatelib.opencloud_caps_to_syndicate_caps( vs.cap_read_data, vs.cap_write_data, vs.cap_host_data )
     RG_port = vs.RG_portnum
     UG_port = vs.UG_portnum
     slice_secret = None
     
     config = syndicatelib.get_config()
     try:
        observer_secret = config.SYNDICATE_OPENCLOUD_SECRET
        RG_closure = config.SYNDICATE_RG_CLOSURE
        observer_pkey_path = config.SYNDICATE_PRIVATE_KEY
        syndicate_url = config.SYNDICATE_SMI_URL
        
     except Exception, e:
        traceback.print_exc()
        logger.error("syndicatelib config is missing one or more of the following: SYNDICATE_OPENCLOUD_SECRET, SYNDICATE_RG_CLOSURE, SYNDICATE_PRIVATE_KEY, SYNDICATE_SMI_URL",extra=vs.tologdict())
        raise e