X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=db-config.d%2F002-system_site;h=15646949856b4c815a05e4fe81403fe839d0b4b0;hb=2d763c5797f31cc782ae63901b1dd3e48ba41173;hp=4a60581343bdd910ab3b8fd473dcb4b99c9cc6da;hpb=21d187714285d9818fd94509b015ba069facb7ef;p=plcapi.git diff --git a/db-config.d/002-system_site b/db-config.d/002-system_site index 4a60581..1564694 100644 --- a/db-config.d/002-system_site +++ b/db-config.d/002-system_site @@ -1,5 +1,5 @@ # -*-python-*- -#################### +#################### # Create/update and populate the default site (should be site_id 1) ### plc_www holds the contents of the PLC_WWW configuration category @@ -47,9 +47,8 @@ keyfile=plc['root_ssh_key_pub'] person = GetPersons(the_admin_id)[0] keys = GetKeys(person['key_ids']) if os.path.exists(keyfile): - sshkeyfp = file(keyfile,"r") - sshkey = sshkeyfp.read() - sshkeyfp.close() + with open(keyfile) as feed: + sshkey = feed.read() found=False for key in keys: