PEP8: fix some minor issues
This commit is contained in:
		
							parent
							
								
									e07aa088e6
								
							
						
					
					
						commit
						0809d52e9d
					
				
					 1 changed files with 7 additions and 3 deletions
				
			
		
							
								
								
									
										10
									
								
								check_kernel
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								check_kernel
									
										
									
									
									
								
							| 
						 | 
					@ -87,6 +87,7 @@ def is_debian():
 | 
				
			||||||
def is_fedora():
 | 
					def is_fedora():
 | 
				
			||||||
    return posixpath.exists('/etc/fedora-release')
 | 
					    return posixpath.exists('/etc/fedora-release')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def is_redhat():
 | 
					def is_redhat():
 | 
				
			||||||
    return posixpath.exists('/etc/redhat-release')
 | 
					    return posixpath.exists('/etc/redhat-release')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -106,7 +107,9 @@ def check_output(cmd):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def installed_kernel_versions_debian():
 | 
					def installed_kernel_versions_debian():
 | 
				
			||||||
    dpkg_out = check_output(
 | 
					    dpkg_out = check_output(
 | 
				
			||||||
        ['dpkg-query', '--show', '--showformat', '${Package} ${Version}\n', 'linux-image*'])
 | 
					        ['dpkg-query',
 | 
				
			||||||
 | 
					         '--show', '--showformat', '${Package} ${Version}\n',
 | 
				
			||||||
 | 
					         'linux-image*'])
 | 
				
			||||||
    dpkg_out = dpkg_out.strip()
 | 
					    dpkg_out = dpkg_out.strip()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    versions = dpkg_out.split('\n')
 | 
					    versions = dpkg_out.split('\n')
 | 
				
			||||||
| 
						 | 
					@ -142,7 +145,8 @@ def clean_kernel_version(version):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def main():
 | 
					def main():
 | 
				
			||||||
    if len(sys.argv) > 1:
 | 
					    if len(sys.argv) > 1:
 | 
				
			||||||
        print('This plugin no longer takes the expected kernel version as an argument')
 | 
					        print('This plugin no longer takes the expected kernel version as' +
 | 
				
			||||||
 | 
					              'an argument')
 | 
				
			||||||
        sys.exit(3)
 | 
					        sys.exit(3)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    running = running_kernel_version()
 | 
					    running = running_kernel_version()
 | 
				
			||||||
| 
						 | 
					@ -152,7 +156,7 @@ def main():
 | 
				
			||||||
        print('KERNEL OK - running version %s' % running)
 | 
					        print('KERNEL OK - running version %s' % running)
 | 
				
			||||||
        sys.exit(0)
 | 
					        sys.exit(0)
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
        print('KERNEL WARNING - running version %s, installed: %s' % \
 | 
					        print('KERNEL WARNING - running version %s, installed: %s' %
 | 
				
			||||||
              (running, installed))
 | 
					              (running, installed))
 | 
				
			||||||
        sys.exit(1)
 | 
					        sys.exit(1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue