def get_docker_version_info():
 result = None
 if is_service_running('docker'):
  version_info = yaml.safe_load(get_version_output('/usr/bin/docker', 'version'))
  if ('Server' in version_info):
   result = {'api_version': version_info['Server']['API version'], 'version': version_info['Server']['Version']}
 return result

def get_docker_version_info ( ) : result = None if is_service_running ( 'docker' ) : version_info = yaml . safe_load ( get_version_output ( '/usr/bin/docker' , 'version' ) ) if ( 'Server' in version_info ) : result = { 'api_version' : version_info [ 'Server' ] [ 'API version' ] , 'version' : version_info [ 'Server' ] [ 'Version' ] } return result
parses and returns the docker version info .