Skip to content

Commit 85fdd9b

Browse files
committed
Drop SiteInformation.email (OSG_CONTACT_EMAIL) (SOFTWARE-3471)
1 parent 3a2ad5d commit 85fdd9b

File tree

3 files changed

+4
-44
lines changed

3 files changed

+4
-44
lines changed

config/40-siteinfo.ini

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ resource = UNAVAILABLE
3535
; YOU WILL NEED TO CHANGE THIS
3636
contact = UNAVAILABLE
3737

38-
; Set "email" to the email address of the admin/technical contact for the cluster.
39-
;
40-
; YOU WILL NEED TO CHANGE THIS
41-
email = UNAVAILABLE
42-
4338
; Set "city" to the city that the cluster is located in.
4439
;
4540
; YOU WILL NEED TO CHANGE THIS

osg_configure/configure_modules/siteinformation.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ def __init__(self, *args, **kwargs):
4747
configfile.Option(name='contact',
4848
required=MANDATORY_ON_CE,
4949
mapping='OSG_CONTACT_NAME'),
50-
'email':
51-
configfile.Option(name='email',
52-
required=MANDATORY_ON_CE,
53-
mapping='OSG_CONTACT_EMAIL'),
5450
'city':
5551
configfile.Option(name='city',
5652
required=MANDATORY_ON_CE,
@@ -96,7 +92,10 @@ def parse_configuration(self, configuration):
9692
self.log('SiteInformation.parse_configuration completed')
9793
return
9894

99-
self.get_options(configuration)
95+
self.get_options(configuration,
96+
ignore_options=[
97+
"email",
98+
])
10099
self.log('SiteInformation.parse_configuration completed')
101100

102101
# pylint: disable-msg=W0613
@@ -152,16 +151,6 @@ def check_attributes(self, attributes):
152151
level=logging.ERROR)
153152
attributes_ok = False
154153

155-
email = self.opt_val("email")
156-
# make sure the email address has the correct format
157-
if not utilities.blank(email) and not validation.valid_email(email):
158-
self.log("Invalid email address in site information: %s" %
159-
email,
160-
section=self.config_section,
161-
option='email',
162-
level=logging.ERROR)
163-
attributes_ok = False
164-
165154
sponsor = self.opt_val("sponsor")
166155
if not utilities.blank(sponsor):
167156
attributes_ok &= self.check_sponsor(sponsor)

tests/test_siteattributes.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def testParsing1(self):
5656
'OSG_SPONSOR': 'osg:100',
5757
'OSG_SITE_INFO': 'http://example/com/policy.html',
5858
'OSG_CONTACT_NAME': 'Admin Name',
59-
'OSG_CONTACT_EMAIL': '[email protected]',
6059
'OSG_SITE_CITY': 'Chicago',
6160
'OSG_SITE_COUNTRY': 'US',
6261
'OSG_SITE_LONGITUDE': '84.23',
@@ -91,7 +90,6 @@ def testParsing2(self):
9190
'OSG_SPONSOR': 'osg:50 usatlas:50',
9291
'OSG_SITE_INFO': 'http://example/com/policy.html',
9392
'OSG_CONTACT_NAME': 'Admin Name',
94-
'OSG_CONTACT_EMAIL': '[email protected]',
9593
'OSG_SITE_CITY': 'Chicago',
9694
'OSG_SITE_COUNTRY': 'US',
9795
'OSG_SITE_LONGITUDE': '-84.23',
@@ -126,7 +124,6 @@ def testParsing3(self):
126124
'OSG_SPONSOR': 'osg:50 usatlas:50',
127125
'OSG_SITE_INFO': 'http://example/com/policy.html',
128126
'OSG_CONTACT_NAME': 'Admin Name',
129-
'OSG_CONTACT_EMAIL': '[email protected]',
130127
'OSG_SITE_CITY': 'Chicago',
131128
'OSG_SITE_COUNTRY': 'US',
132129
'OSG_SITE_LONGITUDE': '-84.23',
@@ -160,7 +157,6 @@ def testMissingAttribute(self):
160157
# ^ TODO OSG 3.5: add "resource" to this list
161158
mandatory_on_ce = ['host_name',
162159
'contact',
163-
'email',
164160
'city',
165161
'country',
166162
'longitude',
@@ -267,26 +263,6 @@ def testInvalidHostname(self):
267263
self.assertFalse(settings.check_attributes(attributes),
268264
"Invalid hostname ignored")
269265

270-
def testInvalidEmail(self):
271-
"""
272-
Test the check_attributes with invalid email
273-
"""
274-
275-
config_file = get_test_config("siteattributes/" \
276-
"invalid_email.ini")
277-
configuration = configparser.SafeConfigParser()
278-
configuration.read(config_file)
279-
280-
settings = siteinformation.SiteInformation(logger=global_logger)
281-
try:
282-
settings.parse_configuration(configuration)
283-
except Exception as e:
284-
self.fail("Received exception while parsing configuration: %s" % e)
285-
286-
attributes = settings.get_attributes()
287-
self.assertFalse(settings.check_attributes(attributes),
288-
"Invalid email ignored")
289-
290266
def testInvalidSponsor1(self):
291267
"""
292268
Test the check_attributes where the sponsor percentages

0 commit comments

Comments
 (0)