Activates iLO license.

        :param key: iLO license key.
        :raises: IloError, on an error from iLO.
498864
def activate_license(self, key):
        
        sushy_manager = self._get_sushy_manager(PROLIANT_MANAGER_ID)
        try:
            sushy_manager.set_license(key)
        except sushy.exceptions.SushyError as e:
            msg = (self._('The Redfish controller failed to update '
                          'the license. Error %(error)s') %
                   {'error': str(e)})
            LOG.debug(msg)
            raise exception.IloError(msg)
534930
def set_key(self, key):
        
        is_non_empty_string(key)

        self.policies.append(('eq', '$key', key))
        self.form_data['key'] = key
        self.key = key
1156813
public void
setTSIG(TSIG key, int error, TSIGRecord querytsig) {
	this.tsigkey = key;
	this.tsigerror = error;
	this.querytsig = querytsig;
}
1099971
def in_config(self, key):
        
        # if the requested key is an alias, then return the proper key
        key = self._real_key(key)

        exists = self._config.get(key)
        return exists
344216
def activate(name):
    '''
    

    '''
    ret = {'name': name,
           'result': True,
           'comment': '',
           'changes': {}}

    product_key = name

    license_info = __salt__['license.info']()
    licensed = False
    key_match = False
    if license_info is not None:
        licensed = license_info['licensed']
        key_match = license_info['partial_key'] in product_key

    if not key_match:
        out = __salt__['license.install'](product_key)
        licensed = False
        if 'successfully' not in out:
            ret['result'] = False
            ret['comment'] += 'Unable to install the given product key is it valid?'
            return ret
    if not licensed:
        out = __salt__['license.activate']()
        if 'successfully' not in out:
            ret['result'] = False
            ret['comment'] += 'Unable to activate the given product key.'
            return ret
        ret['comment'] += 'Windows is now activated.'
    else:
        ret['comment'] += 'Windows is already activated.'
    return ret
438985
def RegisterTextKey(cls, key, atomid):
        
        def getter(tags, key):
            return tags[atomid]

        def setter(tags, key, value):
            tags[atomid] = value

        def deleter(tags, key):
            del(tags[atomid])

        cls.RegisterKey(key, getter, setter, deleter)
1203199
def bind(self, key, **prefs):
        
        hash_algo = prefs.pop('hash', None)

        if self.is_primary and not key.is_primary:
            sig_type = SignatureType.Subkey_Binding

        elif key.is_primary and not self.is_primary:
            sig_type = SignatureType.PrimaryKey_Binding

        else:  # pragma: no cover
            raise PGPError

        sig = PGPSignature.new(sig_type, self.key_algorithm, hash_algo, self.fingerprint.keyid)

        if sig_type == SignatureType.Subkey_Binding:
            # signature options that only make sense in subkey binding signatures
            usage = prefs.pop('usage', None)

            if usage is not None:
                sig._signature.subpackets.addnew('KeyFlags', hashed=True, flags=usage)

            # if possible, have the subkey create a primary key binding signature
            if key.key_algorithm.can_sign:
                subkeyid = key.fingerprint.keyid
                esig = None

                if not key.is_public:
                    esig = key.bind(self)

                elif subkeyid in self.subkeys:  # pragma: no cover
                    esig = self.subkeys[subkeyid].bind(self)

                if esig is not None:
                    sig._signature.subpackets.addnew('EmbeddedSignature', hashed=False, _sig=esig._signature)

        return self._sign(key, sig, **prefs)
655370
def check_key(self, key: str) -> bool:
        
        keys = self.get_keys()
        return key in keys
1285786
def load_key(self, key):
        

        self._serialize(key)
        if isinstance(key, rsa.RSAPrivateKey):
            self.priv_key = key
            self.pub_key = key.public_key()
        else:
            self.pub_key = key

        return self
757120
def _check_valid_key(self, key):
        
        if not isinstance(key, key_type) and key is not None:
            raise ValueError('%r is not a valid key type' % key)
        if not VALID_KEY_RE_EXTENDED.match(key) or key == u'/':
            raise ValueError('%r contains illegal characters' % key)
11638
def key_exists(self, key):
        
        assert isinstance(key, str)
        self._close()
        try:
            return self._unsafe_key_exists(key)
        finally:
            self._open()
352980
def validate_key(self, key):
        
        if not key:
            name = self.__class__.__name__
            msg = "%s response missing %s" % (name, self.key_name)
            raise ValidationException(msg, self)
        elif not isinstance(key, str):
            msg = "Response contains invalid %s type" % self.key_name
            raise ValidationException(msg, type(key))
981119
def send_key(self, key):
        
        # Sanity check it's a valid key
        if key not in KEYS:
            return ['error', None]

        url = 'http://%s/WAN/%s/%s_ctrl.cgi' % (self._host, 'dvdr', 'dvdr')
        data = ('cCMD_RC_%s.x=100&cCMD_RC_%s.y=100' % (key, key)).encode()

        return self.send_cmd(url, data)
1031875
def activate(self, key):
        
        url = self._base + 'user/activate'
        r = requests.get(url, params={
            'activation_key': key
        })
        r.raise_for_status()
845060
def _check_key(self, key):
        
        self.setup_schema()
        if key not in self._attrs and key not in self:
            raise KeyError(key)
1345513
def init_instance(self, key):
        
        with self._mor_lock:
            if key not in self._mor:
                self._mor[key] = {}
1249614
def activate(options = {})
      options = options.merge(
        user_name: @user_name,
        certificate_id: @id,
        status: "Active"
      )
      resp = @client.update_signing_certificate(options)
      resp.data
    end