def create_auth(self, xrn, create_parents=False):
        hrn, type = urn_to_hrn(str(xrn))

        # create the parent authority if necessary
        parent_hrn = get_authority(hrn)
        parent_urn = hrn_to_urn(parent_hrn, 'authority')
        if (parent_hrn) and (not self.auth_exists(parent_urn)) and (create_parents):
            self.create_auth(parent_urn, create_parents)
        (directory, gid_filename, privkey_filename,) = \
            self.get_auth_filenames(hrn)

        # create the directory to hold the files
        try:
            os.makedirs(directory)
        # if the path already exists then pass
        except __HOLE__, (errno, strerr):
            if errno == 17:
                pass

        if os.path.exists(privkey_filename):
            pkey = Keypair(filename = privkey_filename)
        else:
            pkey = Keypair(create = True)
            pkey.save_to_file(privkey_filename)

        gid = self.create_gid(xrn, create_uuid(), pkey)
        gid.save_to_file(gid_filename, save_parents=True)
dataset/ETHPy150Open fp7-ofelia/ocf/vt_manager/src/python/vt_manager/communication/sfa/trust/hierarchy.py/Hierarchy.create_auth