Logo Search packages:      
Sourcecode: ufw version File versions

def src::frontend::UFWFrontend::application_add (   self,
  profile 
)

Refresh application profile

Definition at line 650 of file frontend.py.

00650                                       :
        '''Refresh application profile'''
        rstr = ""
        policy = ""
        default = self.backend.defaults['default_application_policy']
        if default == "skip":
            ufw.util.debug("Policy is '%s', not adding profile '%s'" % \
                           (policy, profile))
            return rstr
        elif default == "accept":
            policy = "allow"
        elif default == "drop":
            policy = "deny"
        else:
            err_msg = _("Unknown policy '%s'" % default)
            raise UFWError(err_msg)

        args = [ 'ufw' ]
        if self.backend.dryrun:
            args.append("--dry-run")

        args += [ policy, profile ]
        try:
            (action, rule, ip_version, self.backend.dryrun) = \
                parse_command(args)
        except Exception:
            raise

        rstr = self.do_action(action, rule, ip_version)
        return rstr

    def do_application_action(self, action, profile):


Generated by  Doxygen 1.6.0   Back to index