- elif node['boot_nonce']:
- # Allow very old nodes that do not have a node key in
- # their configuration files to use their "boot nonce"
- # instead. The boot nonce is a random value generated
- # by the node itself and POSTed by the Boot CD when it
- # requests the Boot Manager. This is obviously not
- # very secure, so we only allow it to be used if the
- # requestor IP is the same as the IP address we have
- # on record for the node.
- key = node['boot_nonce']
-
- nodenetwork = None
- if node['nodenetwork_ids']:
- nodenetworks = NodeNetworks(method.api, node['nodenetwork_ids'])
- for nodenetwork in nodenetworks:
- if nodenetwork['is_primary']:
- break
-
- if not nodenetwork or not nodenetwork['is_primary']:
- raise PLCAuthenticationFailure, "No primary network interface on record"
-
- if method.source is None:
- raise PLCAuthenticationFailure, "Cannot determine IP address of requestor"
-
- if nodenetwork['ip'] != method.source[0]:
- raise PLCAuthenticationFailure, "Requestor IP %s does not match node IP %s" % \
- (method.source[0], nodenetwork['ip'])