Skip to content

Commit 3d54317

Browse files
committed
Add ResourceCatalog.format_value() for getting just the value of OSG_ResourceCatalog
1 parent 8592cd3 commit 3d54317

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

osg_configure/modules/resourcecatalog.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ def as_attributes(self):
136136
return attributes
137137

138138

139-
140139
class ResourceCatalog(object):
141140
"""Class for building an OSG_ResourceCatalog attribute in condor-ce configs for the ce-collector"""
142141

@@ -148,7 +147,7 @@ def add_rcentry(self, rcentry):
148147

149148
return self
150149

151-
def compose_text(self):
150+
def format_value(self) -> str:
152151
"""Return the OSG_ResourceCatalog classad attribute made of all the entries in this object"""
153152
if not self.entries:
154153
catalog = '{}'
@@ -164,5 +163,8 @@ def compose_text(self):
164163
catalog = ('{ \\\n'
165164
+ ', \\\n'.join(entry_texts)
166165
+ ' \\\n}')
166+
return catalog
167167

168+
def compose_text(self):
169+
catalog = self.format_value()
168170
return 'OSG_ResourceCatalog = ' + catalog

osg_configure/modules/subcluster.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ class ResourceCatalog: # forward declaration for type checking
228228
def compose_text(self) -> str:
229229
pass
230230

231+
def format_value(self) -> str:
232+
pass
233+
231234

232235
def resource_catalog_from_config(config: ConfigParser, default_allowed_vos: List[str] = None) -> ResourceCatalog:
233236
"""

0 commit comments

Comments
 (0)