@@ -74,7 +74,7 @@ def resolve_ambari_config(self):
7474 raise Exception ("No config found, use default" )
7575
7676 except Exception as err :
77- log .warn (err )
77+ log .warning (err )
7878 return config
7979
8080 # Return first ip adress
@@ -200,7 +200,7 @@ def getSystemResourceOverrides(self):
200200 for key , value in data .items ():
201201 systemResources [key ] = data [key ]
202202 except :
203- log .warn (
203+ log .warning (
204204 f"Cannot read values from json files in { systemResourceDir } . it won't be used for gathering system resources."
205205 )
206206 else :
@@ -308,7 +308,7 @@ def getUptimeSeconds(self):
308308 )
309309 return int (result )
310310 except :
311- log .warn ("Can not get SwapFree" )
311+ log .warning ("Can not get SwapFree" )
312312 return 0
313313
314314 # Return memoryfree
@@ -323,7 +323,7 @@ def getMemoryFree(self):
323323 )
324324 return result
325325 except :
326- log .warn ("Can not get MemoryFree" )
326+ log .warning ("Can not get MemoryFree" )
327327 return 0
328328
329329 # Return memorytotal
@@ -338,7 +338,7 @@ def getMemoryTotal(self):
338338 )
339339 return result
340340 except :
341- log .warn ("Can not get MemoryTotal" )
341+ log .warning ("Can not get MemoryTotal" )
342342 return 0
343343
344344 # Return swapfree
@@ -353,7 +353,7 @@ def getSwapFree(self):
353353 )
354354 return result
355355 except :
356- log .warn ("Can not get SwapFree" )
356+ log .warning ("Can not get SwapFree" )
357357 return 0
358358
359359 # Return swapsize
@@ -368,7 +368,7 @@ def getSwapSize(self):
368368 )
369369 return result
370370 except :
371- log .warn ("Can not get SwapFree" )
371+ log .warning ("Can not get SwapFree" )
372372 return 0
373373
374374 # Return memorysize
@@ -383,7 +383,7 @@ def getMemorySize(self):
383383 )
384384 return result
385385 except :
386- log .warn ("Can not get MemorySize" )
386+ log .warning ("Can not get MemorySize" )
387387 return 0
388388
389389 def facterInfo (self ):
@@ -437,7 +437,7 @@ def setDataIfConfigShortOutput():
437437 return_code , stdout , stderr = run_os_command (FacterLinux .GET_IFCONFIG_SHORT_CMD )
438438 return stdout
439439 except OSError :
440- log .warn (f"Can't execute { FacterLinux .GET_IFCONFIG_SHORT_CMD } " )
440+ log .warning (f"Can't execute { FacterLinux .GET_IFCONFIG_SHORT_CMD } " )
441441 return ""
442442
443443 # Returns the output of `ip link` command
@@ -447,7 +447,7 @@ def setDataIpLinkOutput():
447447 return_code , stdout , stderr = run_os_command (FacterLinux .GET_IP_LINK_CMD )
448448 return stdout
449449 except OSError :
450- log .warn (f"Can't execute { FacterLinux .GET_IP_LINK_CMD } " )
450+ log .warning (f"Can't execute { FacterLinux .GET_IP_LINK_CMD } " )
451451 return ""
452452
453453 @staticmethod
@@ -456,7 +456,7 @@ def setDataUpTimeOutput():
456456 return_code , stdout , stderr = run_os_command (FacterLinux .GET_UPTIME_CMD )
457457 return stdout
458458 except OSError :
459- log .warn (f"Can't execute { FacterLinux .GET_UPTIME_CMD } " )
459+ log .warning (f"Can't execute { FacterLinux .GET_UPTIME_CMD } " )
460460 return ""
461461
462462 @staticmethod
@@ -465,7 +465,7 @@ def setMemInfoOutput():
465465 return_code , stdout , stderr = run_os_command (FacterLinux .GET_MEMINFO_CMD )
466466 return stdout
467467 except OSError :
468- log .warn (f"Can't execute { FacterLinux .GET_MEMINFO_CMD } " )
468+ log .warning (f"Can't execute { FacterLinux .GET_MEMINFO_CMD } " )
469469 return ""
470470
471471 # Returns the FQDN of the host
@@ -479,7 +479,7 @@ def isSeLinux(self):
479479 if se_status :
480480 return True
481481 except OSError :
482- log .warn (f"Could not run { FacterLinux .GET_SE_LINUX_ST_CMD } : OK" )
482+ log .warning (f"Could not run { FacterLinux .GET_SE_LINUX_ST_CMD } : OK" )
483483 return False
484484
485485 def return_first_words_from_list (self , list ):
@@ -549,7 +549,7 @@ def get_ip_address_by_ifname(self, ifname):
549549 )[20 :24 ]
550550 )
551551 except Exception as err :
552- log .warn (f"Can't get the IP address for { ifname } " )
552+ log .warning (f"Can't get the IP address for { ifname } " )
553553
554554 return ip_address_by_ifname
555555
@@ -566,7 +566,7 @@ def getInterfaces(self):
566566 if result != "" :
567567 return result
568568 # If the host has neither `ifocnfig` command nor `ip` command, then return "OS NOT SUPPORTED"
569- log .warn (
569+ log .warning (
570570 f"Can't get a network interfaces list from { self .DATA_IFCONFIG_SHORT_OUTPUT } "
571571 )
572572 return "OS NOT SUPPORTED"
@@ -578,7 +578,7 @@ def getUptimeSeconds(self):
578578 self .data_return_first (FacterLinux .DIGITS_REGEXP , self .DATA_UPTIME_OUTPUT )
579579 )
580580 except ValueError :
581- log .warn (f"Can't get an uptime value from { self .DATA_UPTIME_OUTPUT } " )
581+ log .warning (f"Can't get an uptime value from { self .DATA_UPTIME_OUTPUT } " )
582582 return 0
583583
584584 # Return memoryfree
@@ -589,7 +589,7 @@ def getMemoryFree(self):
589589 self .data_return_first (FacterLinux .FREEMEM_REGEXP , self .DATA_MEMINFO_OUTPUT )
590590 )
591591 except ValueError :
592- log .warn (f"Can't get free memory size from { self .DATA_MEMINFO_OUTPUT } " )
592+ log .warning (f"Can't get free memory size from { self .DATA_MEMINFO_OUTPUT } " )
593593 return 0
594594
595595 # Return memorytotal
@@ -599,7 +599,7 @@ def getMemoryTotal(self):
599599 self .data_return_first (FacterLinux .TOTALMEM_REGEXP , self .DATA_MEMINFO_OUTPUT )
600600 )
601601 except ValueError :
602- log .warn (f"Can't get total memory size from { self .DATA_MEMINFO_OUTPUT } " )
602+ log .warning (f"Can't get total memory size from { self .DATA_MEMINFO_OUTPUT } " )
603603 return 0
604604
605605 # Return swapfree
@@ -610,7 +610,7 @@ def getSwapFree(self):
610610 self .data_return_first (FacterLinux .SWAPFREE_REGEXP , self .DATA_MEMINFO_OUTPUT )
611611 )
612612 except ValueError :
613- log .warn (f"Can't get free swap memory size from { self .DATA_MEMINFO_OUTPUT } " )
613+ log .warning (f"Can't get free swap memory size from { self .DATA_MEMINFO_OUTPUT } " )
614614 return 0
615615
616616 # Return swapsize
@@ -621,7 +621,7 @@ def getSwapSize(self):
621621 self .data_return_first (FacterLinux .SWAPTOTAL_REGEXP , self .DATA_MEMINFO_OUTPUT )
622622 )
623623 except ValueError :
624- log .warn (f"Can't get total swap memory size from { self .DATA_MEMINFO_OUTPUT } " )
624+ log .warning (f"Can't get total swap memory size from { self .DATA_MEMINFO_OUTPUT } " )
625625 return 0
626626
627627 # Return memorysize
@@ -632,7 +632,7 @@ def getMemorySize(self):
632632 self .data_return_first (FacterLinux .TOTALMEM_REGEXP , self .DATA_MEMINFO_OUTPUT )
633633 )
634634 except ValueError :
635- log .warn (f"Can't get memory size from { self .DATA_MEMINFO_OUTPUT } " )
635+ log .warning (f"Can't get memory size from { self .DATA_MEMINFO_OUTPUT } " )
636636 return 0
637637
638638 def facterInfo (self ):
0 commit comments