[Planetlab-devel] editRecord.py (geniwrapper)

Faiyaz Ahmed faiyaza at CS.Princeton.EDU
Mon Jun 29 14:19:35 EDT 2009


Hi Scott and Ihsan,

Please take a look at getRecord.py and setRecord.py.  I believe they  
subsume what editRecord could do.

getRecord will display a record collected from sfi and setRecord can  
edit fields in it.

For example:
# to get a record from sfi, and write it to ~/.sfi/
$ ./sfi.py show -o faiyaza.record plc.princeton.faiyaza

# to see what is in this record
$ /getRecord.py < ~/.sfi/faiyaza.record
last_name: Ahmed
...

# to edit a field in the record
./setRecord.py last_name=foo < ~/.sfi/faiyaza.record > ~/.sfi/ 
faiyaza.new.record

# to display the new record
$ ./getRecord.py < ~/.sfi/faiyaza.new.record
last_name: foo

Use the --help flag for more information.

Your comments are more than welcome.   Please let me know if these  
utilities need anything else.


Faiyaz


On Jun 29, 2009, at 1:30 PM, Scott Baker wrote:

> There have been some changes to the record class and editRecord.py has
> fallen a bit behind. It's on my to-do list to look into the changes
> and get editRecord.py back up to date. In the meantime, the records
> are XML files, so it should be possible to manually edit them with any
> text editor. EditRecord.py really only served as an automated tool to
> edit the XML for the user.
>
> I was able to make a simple code substitution last week and get some
> rudimentary editRecord functionality working:
>
>   geni_info = record["geni_info"][0] # record.get_geni_info()
>
> However, looking at the changes in record.py, I can see that there are
> some significant changes; In particular there are now individual
> classes for user records, slice records, etc. Tony: if you can give me
> a quick sample on how to use these classes, I can see if I can get
> editRecord.py updated to use them.
>
> Scott
>
> On Mon, Jun 29, 2009 at 9:32 AM, Ihsan Qazi<iqazi at bbn.com> wrote:
>> Hi,
>>
>> While trying to create slices via the sfi, I noticed that the  
>> editRecord.py
>> (in /geniwrapper/trunk/cmdline/) file contains a call to a function  
>> that is
>> no longer part of the GeniRecord class. Therefore, when I try  
>> creating a new
>> record, I get the following error:
>>
>> python ./editRecord.py --hrn plc.pl.testslice --pubkeyfile  
>> testkey.pkey
>> --type slice --addresearcher $SFI_USER --outfile testslice_record
>> Traceback (most recent call last):
>>   File "./editRecord.py", line 218, in <module>
>>     main()
>>   File "./editRecord.py", line 161, in main
>>     geni_info = record.get_geni_info()
>> AttributeError: 'GeniRecord' object has no attribute 'get_geni_info'
>>
>> Thanks!
>> Ihsan
>>
>> _______________________________________________
>> Devel mailing list
>> Devel at lists.planet-lab.org
>> https://lists.planet-lab.org/mailman/listinfo/devel
>>
>>
>
> _______________________________________________
> Devel mailing list
> Devel at lists.planet-lab.org
> https://lists.planet-lab.org/mailman/listinfo/devel



More information about the Devel mailing list