X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=api-config;h=e6576419354d526451e002455c04c9366229bc94;hb=6d79b6f68d7ab17fa65be6c92698cb51075e43e3;hp=b7b4eee91483b9d7fa029f89b7392ee4f323d891;hpb=c422d72098b31a8013b443663c4498afd80fd418;p=myplc.git diff --git a/api-config b/api-config index b7b4eee..e657641 100755 --- a/api-config +++ b/api-config @@ -6,7 +6,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: api-config,v 1.13 2006/06/23 20:33:28 mlhuang Exp $ +# $Id: api-config,v 1.15 2006/07/11 20:57:25 mlhuang Exp $ # from plc_config import PLCConfiguration @@ -75,49 +75,5 @@ def main(): except Exception, e: print "Warning: Could not generate API certificate: ", e - # For backward compatibility, until we can convert all code to use - # the now standardized variable names. - - # API expects root SSH public key to be at /etc/planetlab/node_root_key - if not os.path.exists("/etc/planetlab/node_root_key"): - os.symlink(plc['root_ssh_key_pub'], "/etc/planetlab/node_root_key") - - # Old variable names littered throughout the API - old_variables = {'PL_API_SERVER': plc_api['host'], - 'PL_API_PATH': plc_api['path'], - 'PL_API_PORT': plc_api['port'], - 'PL_API_CAPABILITY_AUTH_METHOD': "capability", - 'PL_API_CAPABILITY_PASS': plc_api['maintenance_password'], - 'PL_API_CAPABILITY_USERNAME': plc_api['maintenance_user'], - 'PLANETLAB_SUPPORT_EMAIL': plc_mail['support_address'], - 'BOOT_MESSAGES_EMAIL': plc_mail['boot_address'], - 'WWW_BASE': plc_www['host'], - 'BOOT_BASE': plc_boot['host'], - - 'MA_SA_NAMESPACE': plc_ma_sa['namespace'], - 'SESSION_LENGTH_HOURS': "24", - 'ROOT_CA_EMAIL': root_ca_email, - 'ROOT_CA_PUB_KEY': plc_ma_sa['ca_ssl_key_pub'], - 'API_CERT_PATH': plc_ma_sa['api_crt'], - 'MA_SA_PRIVATE_KEY': plc_ma_sa['ssl_key'], - 'PL_API_TICKET_KEY_FILE': plc_ma_sa['ssl_key']} - - # The format of an "allowed maintenance source" specification is - # - # ip:max_role_id:organization_id:password - # - # It is unlikely that we will let federated sites use the - # maintenance account to access each others' APIs, so we always - # set organization_id to -1. - old_variables['PL_API_CAPABILITY_SOURCES'] = " ".join( - ["%s:-1:-1:%s" % (ip, plc_api['maintenance_password']) \ - for ip in plc_api['maintenance_sources'].split()]) - - old_config = open("/etc/planetlab/plc_api", "w") - for name, value in old_variables.iteritems(): - old_config.write("%s='%s'\n" % (name, value)) - old_config.close() - - if __name__ == '__main__': main()