- "sfi client configuration"
- dir_name=self.confsubdir("dot-sfi",clean=True)
- file_name=dir_name + os.sep + sfa_spec['piuser'] + '.pkey'
- fileconf=open(file_name,'w')
- fileconf.write (self.plc_spec['keys'][0]['private'])
- fileconf.close()
- utils.header ("(Over)wrote %s"%file_name)
-
- file_name=dir_name + os.sep + 'sfi_config'
- fileconf=open(file_name,'w')
- SFI_AUTH="%s.%s"%(sfa_spec['SFA_REGISTRY_ROOT_AUTH'],sfa_spec['login_base'])
- fileconf.write ("SFI_AUTH='%s'"%SFI_AUTH)
- fileconf.write('\n')
- SFI_USER=SFI_AUTH + '.' + sfa_spec['piuser']
- fileconf.write ("SFI_USER='%s'"%SFI_USER)
- fileconf.write('\n')
- SFI_REGISTRY='http://' + sfa_spec['SFA_PLC_DB_HOST'] + ':12345/'
- fileconf.write ("SFI_REGISTRY='%s'"%SFI_REGISTRY)
- fileconf.write('\n')
- SFI_SM='http://' + sfa_spec['SFA_PLC_DB_HOST'] + ':12347/'
- fileconf.write ("SFI_SM='%s'"%SFI_SM)
- fileconf.write('\n')
- fileconf.close()
- utils.header ("(Over)wrote %s"%file_name)
-
- file_name=dir_name + os.sep + 'person.xml'
- fileconf=open(file_name,'w')
- for record in sfa_spec['sfa_person_xml']:
- person_record=record
- fileconf.write(person_record)
- fileconf.write('\n')
- fileconf.close()
- utils.header ("(Over)wrote %s"%file_name)
-
- file_name=dir_name + os.sep + 'slice.xml'
- fileconf=open(file_name,'w')
- for record in sfa_spec['sfa_slice_xml']:
- slice_record=record
- #slice_record=sfa_spec['sfa_slice_xml']
- fileconf.write(slice_record)
- fileconf.write('\n')
- utils.header ("(Over)wrote %s"%file_name)
- fileconf.close()
-
- file_name=dir_name + os.sep + 'slice.rspec'
- fileconf=open(file_name,'w')
- slice_rspec=''
- for (key, value) in sfa_spec['sfa_slice_rspec'].items():
- slice_rspec +=value
- fileconf.write(slice_rspec)
- fileconf.write('\n')
- fileconf.close()
- utils.header ("(Over)wrote %s"%file_name)
-
- # push to the remote root's .sfi
- location = "root/.sfi"
- remote="/vservers/%s/%s"%(self.vservername,location)
- self.test_ssh.copy_abs(dir_name, remote, recursive=True)
+ # cannot use sfa_slice_mapper to pass dir_name
+ for slice_spec in self.plc_spec['sfa']['sfa_slice_specs']:
+ site_spec = self.locate_site (slice_spec['sitename'])
+ test_site = TestSite(self,site_spec)
+ test_slice=TestSliceSfa(self,test_site,slice_spec)
+ dir_name=self.confsubdir("dot-sfi/%s"%slice_spec['slicename'],clean=True,dry_run=self.options.dry_run)
+ test_slice.sfi_config(dir_name)
+ # push into the remote /root/sfi area
+ location = test_slice.sfi_path()
+ remote="%s/%s"%(self.vm_root_in_host(),location)
+ self.test_ssh.mkdir(remote,abs=True)
+ # need to strip last level or remote otherwise we get an extra dir level
+ self.test_ssh.copy_abs(dir_name, os.path.dirname(remote), recursive=True)