Browse Source

Refactor method names

Debugging is confusing when the same names are used for methods
in two different controllers.  Fixing this to more accurately
reflect whats going on.

Change-Id: I3740cd3ae81776cb1ecf066e617e615d880dc2e8
tags/1.2.0
Ade Lee 2 months ago
parent
commit
9750c363f6
2 changed files with 14 additions and 14 deletions
  1. 6
    6
      novajoin/join.py
  2. 8
    8
      novajoin/notifications.py

+ 6
- 6
novajoin/join.py View File

@@ -204,19 +204,19 @@ class JoinController(Controller):
204 204
         managed_services = [metadata[key] for key in metadata.keys()
205 205
                             if key.startswith('managed_service_')]
206 206
         if managed_services:
207
-            self.handle_services(data['hostname'], managed_services)
207
+            self.add_managed_services(data['hostname'], managed_services)
208 208
 
209 209
         compact_services = util.get_compact_services(metadata)
210 210
         if compact_services:
211
-            self.handle_compact_services(hostname_short, compact_services)
211
+            self.add_compact_services(hostname_short, compact_services)
212 212
 
213 213
         self.ipaclient.flush_batch_operation()
214 214
 
215 215
         return data
216 216
 
217
-    def handle_services(self, base_host, services):
217
+    def add_managed_services(self, base_host, services):
218 218
         """Make any host/principal assignments passed into metadata."""
219
-        LOG.debug("In IPAHandleServices")
219
+        LOG.debug("In add_managed_services")
220 220
 
221 221
         hosts_found = list()
222 222
         services_found = list()
@@ -236,7 +236,7 @@ class JoinController(Controller):
236 236
 
237 237
             self.ipaclient.service_add_host(principal, base_host)
238 238
 
239
-    def handle_compact_services(self, base_host_short, service_repr):
239
+    def add_compact_services(self, base_host_short, service_repr):
240 240
         """Make any host/principal assignments passed from metadata
241 241
 
242 242
         This takes a dictionary representation of the services and networks
@@ -270,7 +270,7 @@ class JoinController(Controller):
270 270
         This attempts to do a more compact representation since the nova
271 271
         metadta entries have a limit of 255 characters.
272 272
         """
273
-        LOG.debug("In handle compact services")
273
+        LOG.debug("In add_compact_services")
274 274
 
275 275
         hosts_found = list()
276 276
         services_found = list()

+ 8
- 8
novajoin/notifications.py View File

@@ -165,11 +165,11 @@ class NotificationEndpoint(object):
165 165
             payload_metadata[key] for key in payload_metadata.keys()
166 166
             if key.startswith('managed_service_')]
167 167
         if managed_services:
168
-            join_controller.handle_services(hostname, managed_services)
168
+            join_controller.add_managed_services(hostname, managed_services)
169 169
 
170 170
         compact_services = util.get_compact_services(payload_metadata)
171 171
         if compact_services:
172
-            join_controller.handle_compact_services(
172
+            join_controller.add_compact_services(
173 173
                 hostname_short, compact_services)
174 174
 
175 175
         ipa.flush_batch_operation()
@@ -268,14 +268,14 @@ class NotificationEndpoint(object):
268 268
 
269 269
         compact_services = util.get_compact_services(metadata)
270 270
         if compact_services:
271
-            self.handle_compact_services(ipa, hostname_short,
271
+            self.delete_compact_services(ipa, hostname_short,
272 272
                                          compact_services)
273 273
         managed_services = [metadata[key] for key in metadata.keys()
274 274
                             if key.startswith('managed_service_')]
275 275
         if managed_services:
276
-            self.handle_managed_services(ipa, managed_services)
276
+            self.delete_managed_services(ipa, managed_services)
277 277
 
278
-    def handle_compact_services(self, ipa, host_short, service_repr):
278
+    def delete_compact_services(self, ipa, host_short, service_repr):
279 279
         """Reconstructs and removes subhosts for compact services.
280 280
 
281 281
            Data looks like this:
@@ -289,7 +289,7 @@ class NotificationEndpoint(object):
289 289
             services to be automatically deleted through IPA referential
290 290
             integrity.
291 291
         """
292
-        LOG.debug("In handle compact services")
292
+        LOG.debug("In delete compact services")
293 293
         hosts_found = list()
294 294
 
295 295
         ipa.start_batch_operation()
@@ -304,13 +304,13 @@ class NotificationEndpoint(object):
304 304
                     hosts_found.append(principal_host)
305 305
         ipa.flush_batch_operation()
306 306
 
307
-    def handle_managed_services(self, ipa, services):
307
+    def delete_managed_services(self, ipa, services):
308 308
         """Delete any managed services if possible.
309 309
 
310 310
            Checks to see if the managed service subhost has no managed hosts
311 311
            associations and if so, deletes the host.
312 312
         """
313
-        LOG.debug("In handle_managed_services")
313
+        LOG.debug("In delete_managed_services")
314 314
         hosts_deleted = list()
315 315
         services_deleted = list()
316 316
 

Loading…
Cancel
Save