def init_connection_file(self):
        if self.existing:
            try:
                cf = find_connection_file(self.existing, [self.runtime_dir])
            except Exception:
                self.log.critical("Could not find existing kernel connection file %s", self.existing)
                self.exit(1)
            self.log.debug("Connecting to existing kernel: %s" % cf)
            self.connection_file = cf
        else:
            # not existing, check if we are going to write the file
            # and ensure that self.connection_file is a full path, not just the shortname
            try:
                cf = find_connection_file(self.connection_file, [self.runtime_dir])
            except Exception:
                # file might not exist
                if self.connection_file == os.path.basename(self.connection_file):
                    # just shortname, put it in security dir
                    cf = os.path.join(self.runtime_dir, self.connection_file)
                else:
                    cf = self.connection_file
                self.connection_file = cf
        try:
            self.connection_file = filefind(self.connection_file, ['.', self.runtime_dir])
        except IOError:
            self.log.debug("Connection File not found: %s", self.connection_file)
            return
        
        # should load_connection_file only be used for existing?
        # as it is now, this allows reusing ports if an existing
        # file is requested
        try:
            self.load_connection_file()
        except Exception:
            self.log.error("Failed to load connection file: %r", self.connection_file, exc_info=True)
            self.exit(1)
Per Operation ACL data instance for secret or container.
dataset/ETHPy150Open jupyter/jupyter_client/jupyter_client/consoleapp.py/JupyterConsoleApp.init_connection_file--crossover with--dataset/ETHPy150Open openstack/python-barbicanclient/barbicanclient/acls.py/_PerOperationACL.__init__