@@ -307,25 +307,25 @@ def _get_domain_dn(self):
307307 return self .CACHED_DOMAIN_DN
308308
309309 def _get_server_name (self ):
310- logging .debug ('FCADClient : Getting LDAP service machine name' )
310+ logging .debug ('FCADRetriever : Getting LDAP service machine name' )
311311 # Resolve LDAP service machine
312312 if self .CACHED_SERVER_NAME is None :
313313 result = dns .resolver .query (
314314 '_ldap._tcp.dc._msdcs.%s' % self .DOMAIN .lower (),
315315 'SRV' )
316316 self .CACHED_SERVER_NAME = str (result [0 ].target )[:- 1 ]
317- logging .debug ('FCADClient : LDAP server: %s' % self .CACHED_SERVER_NAME )
317+ logging .debug ('FCADRetriever : LDAP server: %s' % self .CACHED_SERVER_NAME )
318318 return self .CACHED_SERVER_NAME
319319
320320 def _ldap_connect (self ):
321321 """
322322 Connect to AD server
323323 """
324- logging .debug ('FCADClient : Connecting to AD LDAP server' )
324+ logging .debug ('FCADRetriever : Connecting to AD LDAP server' )
325325 server_name = self ._get_server_name ()
326326 # Connect to LDAP using Kerberos
327327 logging .debug (
328- 'FCADClient : Initializing LDAP connection to %s' % server_name )
328+ 'FCADRetriever : Initializing LDAP connection to %s' % server_name )
329329 self .connection = ldap .initialize ('ldap://%s' % server_name )
330330 self .connection .set_option (ldap .OPT_REFERRALS , 0 )
331331 sasl_auth = ldap .sasl .sasl ({}, 'GSSAPI' )
@@ -337,7 +337,7 @@ def _ldap_connect(self):
337337 ('%c%c%c%c%c' % (48 , 3 , 2 , 1 , sdflags )).encode ())
338338 self .connection .set_option (ldap .OPT_SERVER_CONTROLS , [control , ])
339339 self .connection .protocol_version = 3
340- logging .debug ('FCADClient : Binding LDAP connection' )
340+ logging .debug ('FCADRetriever : Binding LDAP connection' )
341341 self .connection .sasl_interactive_bind_s ("" , sasl_auth )
342342
343343 def _get_smb_connection (self , service = 'SysVol' ):
@@ -386,7 +386,7 @@ def get_sid(self, sid_ndr):
386386
387387 def get_profile (self , filter ):
388388 logging .debug (
389- 'FCADClient : Getting profile from AD LDAP. filter: %s' % filter )
389+ 'FCADRetriever : Getting profile from AD LDAP. filter: %s' % filter )
390390 base_dn = "CN=Policies,CN=System,%s" % self ._get_domain_dn ()
391391 attrs = ['cn' , 'displayName' , 'gPCFileSysPath' , 'nTSecurityDescriptor' ]
392392 resultlist = self .connection .search_s (
@@ -399,7 +399,7 @@ def get_profile(self, filter):
399399
400400 def get_profiles (self ):
401401 logging .debug (
402- 'FCADClient : Retrieving profiles' )
402+ 'FCADRetriever : Retrieving profiles' )
403403 profiles = []
404404 base_dn = "CN=Policies,CN=System,%s" % self ._get_domain_dn ()
405405 filter = '(objectclass=groupPolicyContainer)'
@@ -410,24 +410,24 @@ def get_profiles(self):
410410 resdata = res [1 ]
411411 if resdata :
412412 logging .debug (
413- 'FCADClient : Reading profile data: {}' .format (resdata ))
413+ 'FCADRetriever : Reading profile data: {}' .format (resdata ))
414414 profile = self ._read_profile_data (resdata )
415415 if profile is not None :
416416 profiles .append (profile )
417417 logging .debug (
418- 'FCADClient : Read profiles: {}' .format (profiles ))
418+ 'FCADRetriever : Read profiles: {}' .format (profiles ))
419419 return profiles
420420
421421 def get_profile_cifs_data (self , cn ):
422- logging .debug ('FCADClient : Getting CIFs data for profile %s' % cn )
422+ logging .debug ('FCADRetriever : Getting CIFs data for profile %s' % cn )
423423 conn = self ._get_smb_connection ()
424424 furi = '%s\\ Policies\\ %s\\ fleet-commander.json' % (
425425 self .DOMAIN , cn )
426- logging .debug ('FCADClient : Reading CIFs data from %s' % furi )
426+ logging .debug ('FCADRetriever : Reading CIFs data from %s' % furi )
427427 try :
428428 return conn .loadfile (furi )
429429 except Exception as e :
430- logging .error ('FCADClient : Failed reading CIFs data from {}: {}' .format (furi , e ))
430+ logging .error ('FCADRetriever : Failed reading CIFs data from {}: {}' .format (furi , e ))
431431 return None
432432
433433 def get_global_policy (self ):
@@ -438,15 +438,15 @@ def get_global_policy(self):
438438 profile = self .get_profile (ldap_filter )
439439 if profile is not None :
440440 logging .debug (
441- 'FCADClient : Found global policy profile. Reading data.' )
441+ 'FCADRetriever : Found global policy profile. Reading data.' )
442442 data = self .get_profile_cifs_data (profile ['cn' ])
443443 jsondata = json .loads (data )
444444 global_policy = jsondata ['settings' ][FC_GLOBAL_POLICY_NS ].get (
445445 'global_policy' , FC_GLOBAL_POLICY_DEFAULT )
446446 return global_policy
447447
448448 def check_realm (self ):
449- logging .debug ('FCADClient : Checking realm configuration' )
449+ logging .debug ('FCADRetriever : Checking realm configuration' )
450450 sssd_provider = Gio .DBusProxy .new_for_bus_sync (
451451 self .REALMD_BUS ,
452452 Gio .DBusProxyFlags .NONE ,
@@ -458,7 +458,7 @@ def check_realm(self):
458458 realms = sssd_provider .get_cached_property ('Realms' )
459459 if len (realms ) > 0 :
460460 logging .debug (
461- 'FCADClient : realmd queried. Realm object {}' .format (
461+ 'FCADRetriever : realmd queried. Realm object {}' .format (
462462 realms [0 ]))
463463 realm = Gio .DBusProxy .new_for_bus_sync (
464464 self .REALMD_BUS ,
@@ -474,15 +474,15 @@ def check_realm(self):
474474 }
475475 server = details .get ('server-software' , 'not-ad' )
476476 logging .debug (
477- 'FCADClient : Realm details: {} ({})' .format (domain , server ))
477+ 'FCADRetriever : Realm details: {} ({})' .format (domain , server ))
478478 if server != 'active-directory' :
479479 logging .debug (
480- 'FCADClient : Realm is not an Active Directory. Exiting.' )
480+ 'FCADRetriever : Realm is not an Active Directory. Exiting.' )
481481 self .quit ()
482482 return domain
483483 else :
484484 logging .debug (
485- 'FCADClient : This computer is not part of any realm. Exiting.' )
485+ 'FCADRetriever : This computer is not part of any realm. Exiting.' )
486486 self .quit ()
487487
488488 def check_elements_in_list (self , elements , element_list ):
@@ -559,7 +559,7 @@ def process_profile(
559559 fd .close ()
560560
561561 def call_fc_client (self ):
562- logging .debug ('FCADClient : Calling FC client' )
562+ logging .debug ('FCADRetriever : Calling FC client' )
563563 fc = Gio .DBusProxy .new_for_bus_sync (
564564 self .FC_BUS ,
565565 Gio .DBusProxyFlags .NONE ,
@@ -581,17 +581,17 @@ def run(self):
581581 # Connect to LDAP
582582 try :
583583 self ._ldap_connect ()
584- logging .debug ('FCADClient : LDAP connection succesful' )
584+ logging .debug ('FCADRetriever : LDAP connection succesful' )
585585 except Exception as e :
586- logging .error ('FCADClient : LDAP connection failed. {}' .format (e ))
586+ logging .error ('FCADRetriever : LDAP connection failed. {}' .format (e ))
587587 sys .exit (1 )
588588
589589 # First of all, execute a deployment with existing data so we can
590590 # take our time in downloading new data from server
591- logging .debug ('FCADClient : Deploying existing cache data' )
591+ logging .debug ('FCADRetriever : Deploying existing cache data' )
592592 self .call_fc_client ()
593593
594- logging .debug ('FCADClient : Resuming AD profile processing' )
594+ logging .debug ('FCADRetriever : Resuming AD profile processing' )
595595 # Get current user name
596596 username = pwd .getpwuid (os .getuid ()).pw_name .split ('@' )[0 ]
597597 # Get current user UID
@@ -606,7 +606,7 @@ def run(self):
606606 # Get global policy
607607 global_policy = self .get_global_policy ()
608608 # Generate user dir with base user dir path and UID
609- logging .debug ('FCADClient : Generating user cache directory' )
609+ logging .debug ('FCADRetriever : Generating user cache directory' )
610610 userdir = os .path .join (
611611 os .path .expanduser ('~/.cache/fleet-commander-client' ), str (uid ))
612612 profilesdir = os .path .join (userdir , 'profiles' )
@@ -615,7 +615,7 @@ def run(self):
615615 os .makedirs (profilesdir )
616616
617617 # Read all profiles
618- logging .debug ('FCADClient : Reading and processing profiles' )
618+ logging .debug ('FCADRetriever : Reading and processing profiles' )
619619 profiles = self .get_profiles ()
620620 # Process each profile
621621 for profile in profiles :
@@ -624,7 +624,7 @@ def run(self):
624624 username , groups , hostname , global_policy )
625625
626626 # Compile profiles data
627- logging .debug ('FCADClient : Compiling settings data' )
627+ logging .debug ('FCADRetriever : Compiling settings data' )
628628 sc = SettingsCompiler (profilesdir )
629629 compiled_settings = sc .compile_settings ()
630630
@@ -638,7 +638,7 @@ def run(self):
638638 adapter .cleanup_cache ()
639639
640640 # Call FC client dbus service giving user directory and user UID
641- logging .debug ('FCADClient : Deploying AD profiles' )
641+ logging .debug ('FCADRetriever : Deploying AD profiles' )
642642 self .call_fc_client ()
643643
644644
0 commit comments