git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
19fa735
)
merge in rspec_extensions branch
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Fri, 20 May 2011 14:59:00 +0000
(10:59 -0400)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Fri, 20 May 2011 14:59:00 +0000
(10:59 -0400)
sfa/client/sfi.py
patch
|
blob
|
history
sfa/managers/aggregate_manager_pl.py
patch
|
blob
|
history
sfa/plc/aggregate.py
patch
|
blob
|
history
sfa/rspecs/rspec.py
patch
|
blob
|
history
sfa/rspecs/rspec_parser.py
patch
|
blob
|
history
diff --git
a/sfa/client/sfi.py
b/sfa/client/sfi.py
index
5a7ec7f
..
579d38e
100755
(executable)
--- a/
sfa/client/sfi.py
+++ b/
sfa/client/sfi.py
@@
-209,6
+209,10
@@
class Sfi:
parser.add_option("-f", "--format", dest="format", type="choice",
help="display format ([xml]|dns|ip)", default="xml",
choices=("xml", "dns", "ip"))
parser.add_option("-f", "--format", dest="format", type="choice",
help="display format ([xml]|dns|ip)", default="xml",
choices=("xml", "dns", "ip"))
+ #panos: a new option to define the type of information about resources a user is interested in
+ parser.add_option("-i", "--info", dest="info",
+ help="optional component information", default=None)
+
if command in ("resources", "show", "list"):
parser.add_option("-o", "--output", dest="file",
if command in ("resources", "show", "list"):
parser.add_option("-o", "--output", dest="file",
@@
-831,7
+835,7
@@
class Sfi:
if args:
cred = self.get_slice_cred(args[0]).save_to_string(save_parents=True)
hrn = args[0]
if args:
cred = self.get_slice_cred(args[0]).save_to_string(save_parents=True)
hrn = args[0]
-
call_options = {'geni_slice_urn': hrn_to_urn(hrn, 'slice')}
+ call_options = {'geni_slice_urn': hrn_to_urn(hrn, 'slice')}
else:
cred = user_cred
hrn = None
else:
cred = user_cred
hrn = None
@@
-842,6
+846,9
@@
class Sfi:
creds.append(delegated_cred)
if opts.rspec_version:
call_options['rspec_version'] = opts.rspec_version
creds.append(delegated_cred)
if opts.rspec_version:
call_options['rspec_version'] = opts.rspec_version
+ #panos add info options
+ if opts.info:
+ call_options['info'] = opts.info
result = server.ListResources(creds, call_options,unique_call_id())
format = opts.format
if opts.file is None:
result = server.ListResources(creds, call_options,unique_call_id())
format = opts.format
if opts.file is None:
diff --git
a/sfa/managers/aggregate_manager_pl.py
b/sfa/managers/aggregate_manager_pl.py
index
c916c51
..
b39bc21
100644
(file)
--- a/
sfa/managers/aggregate_manager_pl.py
+++ b/
sfa/managers/aggregate_manager_pl.py
@@
-1,4
+1,4
@@
-#!/usr/bin/python
+
import datetime
import time
import datetime
import time
diff --git
a/sfa/plc/aggregate.py
b/sfa/plc/aggregate.py
index
24f84a1
..
6874d64
100644
(file)
--- a/
sfa/plc/aggregate.py
+++ b/
sfa/plc/aggregate.py
@@
-19,9
+19,7
@@
class Aggregate:
def __init__(self, api, user_options={}):
self.api = api
def __init__(self, api, user_options={}):
self.api = api
- #panos
- self.user_options = user_options
- print "[aggregate] options = ",self.user_options
+ self.user_options = user_options
def prepare_sites(self, force=False):
if not self.sites or force:
def prepare_sites(self, force=False):
if not self.sites or force:
@@
-70,17
+68,17
@@
class Aggregate:
self.prepared = True
self.prepared = True
- def get_rspec(self, slice_xrn=None, version = None):
+ def get_rspec(self, slice_xrn=None, version = None
, type=None
):
self.prepare()
rspec = None
rspec_version = RSpecVersion(version)
if rspec_version['type'].lower() == 'protogeni':
self.prepare()
rspec = None
rspec_version = RSpecVersion(version)
if rspec_version['type'].lower() == 'protogeni':
- rspec = PGRSpec()
+ rspec = PGRSpec(
type=type
)
#panos pass user options to SfaRSpec
elif rspec_version['type'].lower() == 'sfa':
#panos pass user options to SfaRSpec
elif rspec_version['type'].lower() == 'sfa':
- rspec = SfaRSpec(
"",{},
self.user_options)
+ rspec = SfaRSpec(
type=type, user_options=
self.user_options)
else:
else:
- rspec = SfaRSpec(
"",{},
self.user_options)
+ rspec = SfaRSpec(
type=type, user_options=
self.user_options)
rspec.add_nodes(self.nodes.values())
rspec.add_nodes(self.nodes.values())
diff --git
a/sfa/rspecs/rspec.py
b/sfa/rspecs/rspec.py
index
7c10a66
..
35aa202
100755
(executable)
--- a/
sfa/rspecs/rspec.py
+++ b/
sfa/rspecs/rspec.py
@@
-14,10
+14,12
@@
class RSpec:
xml = None
type = None
version = None
xml = None
type = None
version = None
- namespaces = None
+ namespaces = None
+ user_options = {}
- def __init__(self, rspec="", namespaces={}, type=None
)
:
+ def __init__(self, rspec="", namespaces={}, type=None
, user_options={}
:
self.type = type
self.type = type
+ self.user_options = user_options
if rspec:
self.parse_rspec(rspec, namespaces)
else:
if rspec:
self.parse_rspec(rspec, namespaces)
else:
diff --git
a/sfa/rspecs/rspec_parser.py
b/sfa/rspecs/rspec_parser.py
index
5625ec7
..
8e3bced
100755
(executable)
--- a/
sfa/rspecs/rspec_parser.py
+++ b/
sfa/rspecs/rspec_parser.py
@@
-15,6
+15,7
@@
def parse_rspec(in_rspec):
out_rspec.xml = rspec.xml
else:
#out_rspec = PGRSpec(in_rspec)
out_rspec.xml = rspec.xml
else:
#out_rspec = PGRSpec(in_rspec)
+ # TODO: determine if this is an ad or request
out_rspec = PGRSpec()
out_rspec.xml = rspec.xml
return out_rspec
out_rspec = PGRSpec()
out_rspec.xml = rspec.xml
return out_rspec