def slice_name_to_urn(self, name):
        """Convert a slice name to a slice urn."""
        # FIXME: Use constants
        base = 'urn:publicid:IDN+'
        # FIXME: Validate name from credential.publicid_to_urn

        # Old OMNI configs did not have authority specified,
        # all we can do with those is append the name to the base        
        if not self.config.has_key('authority'):
            if name.startswith(base):
                return name
            else:
                return base + name
        
        auth = self.config['authority']

        if name.startswith(base):
            if not name.startswith(base+auth+"+slice+"):
                raise Exception("Incorrect slice name")
            return name
        
        if name.startswith(auth):
            return base + name

        if '+' in name:
            raise Exception("Incorrect slice name")
                            
        return base + auth + "+slice+" + name
dataset/ETHPy150Open fp7-ofelia/ocf/expedient/src/python/omnilib/frameworks/framework_gcf.py/Framework.slice_name_to_urn/original