예제 #1
0
 def add_conf_chann(self, activ_key, conf_channel, default):
     if not self.call("configchannel.channelExists", conf_channel):
         raise Exception("Config channel %s doesn't exist" % conf_channel)
         return 2
     else:
         default = Spacewalk.parse_bool(activ_key, default)
         self.call("activationkey.addConfigChannels", activ_key, conf_channel, default)
     return 1
예제 #2
0
 def add_conf_chann(self, activ_key, conf_channel, default):
     if not self.call("configchannel.channelExists", conf_channel):
         raise Exception("Config channel %s doesn't exist" % conf_channel)
         return 2
     else:
         default = Spacewalk.parse_bool(activ_key, default)
         self.call("activationkey.addConfigChannels", activ_key,
                   conf_channel, default)
     return 1
예제 #3
0
    def create(self, channel, ent="0", default=False):
        """
        Create a new activation key. The activation key parameter passed in will be prefixed with the organization ID,
        and this value will be returned from the create call. Eg. If the caller passes in the key "foo" and belong to
        an organization with the ID 100, the actual activation key will be "100-foo". This call allows for the setting
        of a usage limit on this activation key. If unlimited usage is desired see the similarly named API method with
        no usage limit argument.
        """
        def entitlements(code):
            if code == "1":
                return [
                    "virtualization_host",
                ]
            return []

        if self.check_channel_exists(label):
            raise Exception("Channel %s exists" % label)
            return 0
        descritption = BeakerEnv.testname()
        self.call("activationkey.create", '', descritption, channel,
                  entitlements(ent), Spacewalk.parse_bool(default))
        return 1
예제 #4
0
    def create(self, channel, ent="0", default=False):
        """
        Create a new activation key. The activation key parameter passed in will be prefixed with the organization ID,
        and this value will be returned from the create call. Eg. If the caller passes in the key "foo" and belong to
        an organization with the ID 100, the actual activation key will be "100-foo". This call allows for the setting
        of a usage limit on this activation key. If unlimited usage is desired see the similarly named API method with
        no usage limit argument.
        """

        def entitlements(code):
            if code == "1":
                return ["virtualization_host"]
            return []

        if self.check_channel_exists(label):
            raise Exception("Channel %s exists" % label)
            return 0
        descritption = BeakerEnv.testname()
        self.call("activationkey.create", "", descritption, channel, entitlements(ent), Spacewalk.parse_bool(default))
        return 1