def action(self):
        pkiDirpath = os.path.join('/tmp', 'raet', 'test', self.role, 'pki')
        if not os.path.exists(pkiDirpath):
            os.makedirs(pkiDirpath)

        acceptedDirpath = os.path.join(pkiDirpath, 'accepted')
        if not os.path.exists(acceptedDirpath):
            os.makedirs(acceptedDirpath)

        pendingDirpath = os.path.join(pkiDirpath, 'pending')
        if not os.path.exists(pendingDirpath):
            os.makedirs(pendingDirpath)

        rejectedDirpath = os.path.join(pkiDirpath, 'rejected')
        if not os.path.exists(rejectedDirpath):
            os.makedirs(rejectedDirpath)

        localFilepath = os.path.join(pkiDirpath, 'local.key')
        if os.path.exists(localFilepath):
            mode = os.stat(localFilepath).st_mode
            print(mode)
            os.chmod(localFilepath, mode | stat.S_IWUSR | stat.S_IRUSR)
            mode = os.stat(localFilepath).st_mode
            print(mode)

        cacheDirpath = os.path.join('/tmp/raet', 'cache', self.role)
        if not os.path.exists(cacheDirpath):
            os.makedirs(cacheDirpath)

        sockDirpath = os.path.join('/tmp/raet', 'sock', self.role)
        if not os.path.exists(sockDirpath):
            os.makedirs(sockDirpath)

        self.opts.value = dict(
            id=self.role,
            __role=self.role,
            ioflo_period=0.1,
            ioflo_realtime=True,
            ioflo_verbose=2,
            interface="",
            raet_port=self.raet_port,
            transport='raet',
            client_acl=dict(),
            publisher_acl = dict(),
            pki_dir=pkiDirpath,
            sock_dir=sockDirpath,
            cachedir=cacheDirpath,
            open_mode=True,
            auto_accept=True,
            )

        name = "{0}_{1}".format(self.role, self.role)
        basedirpath = os.path.abspath(os.path.join(cacheDirpath, 'raet'))
        keep = salting.SaltKeep(opts=self.opts.value,
                                basedirpath=basedirpath,
                                stackname=name)
        keep.clearLocalData()
        keep.clearLocalRoleData()
        keep.clearAllRemoteData()
        keep.clearAllRemoteRoleData()
Register presence requests
dataset/ETHPy150Open saltstack/salt/salt/daemons/test/plan/actors.py/TestOptsSetup.action