3 from sfa.rspecs.pg_rspec_converter import PGRSpecConverter
4 from sfa.rspecs.sfa_rspec_converter import SfaRSpecConverter
5 from sfa.rspecs.rspec_parser import parse_rspec
11 def to_sfa_rspec(in_rspec):
12 rspec = parse_rspec(in_rspec)
13 if rspec.version['type'] == 'sfa':
15 elif rspec.version['type'] == 'protogeni':
16 return PGRSpecConverter.to_sfa_rspec(in_rspec)
21 def to_pg_rspec(in_rspec):
22 rspec = parse_rspec(in_rspec)
23 if rspec.version['type'] == 'protogeni':
25 elif rspec.version['type'] == 'sfa':
26 return SfaRSpecConverter.to_pg_rspec(in_rspec)
31 if __name__ == '__main__':
32 pg_rspec = 'test/protogeni.rspec'
33 sfa_rspec = 'test/nodes.rspec'
35 print "converting pg rspec to sfa rspec"
36 print RSpecConverter.to_sfa_rspec(pg_rspec)
38 print "converting sfa rspec to pg rspec"
39 print RSpecConverter.to_pg_rspec(sfa_rspec)