arshadmohammad commented on code in PR #3751:
URL: https://github.com/apache/ambari/pull/3751#discussion_r1374894047


##########
ambari-common/src/main/python/ambari_commons/repo_manager/yum_manager.py:
##########
@@ -352,7 +330,7 @@ def rpm_check_package_available(self, name):
     regex = re.compile(name_regex)
 
     for package in packages:
-      if regex.match(package['name']):
+      if regex.match(package['name'].decode()):

Review Comment:
   This is not working, it is failing with following error
   `2023-10-27 19:00:36,138 - Reporting component version failed
   Traceback (most recent call last):
     File 
"/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", 
line 354, in execute
       method(env)
     File 
"/var/lib/ambari-agent/cache/stack-hooks/before-INSTALL/scripts/hook.py", line 
33, in hook
       install_packages()
     File 
"/var/lib/ambari-agent/cache/stack-hooks/before-INSTALL/scripts/shared_initialization.py",
 line 37, in install_packages
       retry_count=params.agent_stack_retry_count)
     File "/usr/lib/ambari-agent/lib/resource_management/core/base.py", line 
123, in __new__
       cls(names_list.pop(0), env, provider, **kwargs)
     File "/usr/lib/ambari-agent/lib/resource_management/core/base.py", line 
164, in __init__
       self.env.run()
     File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", 
line 163, in run
       self.run_action(resource, action)
     File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", 
line 127, in run_action
       provider_action()
     File 
"/usr/lib/ambari-agent/lib/resource_management/core/providers/packaging.py", 
line 30, in action_install
       self._pkg_manager.install_package(package_name, self.__create_context())
     File 
"/usr/lib/ambari-agent/lib/ambari_commons/repo_manager/yum_manager.py", line 
211, in install_package
       elif not self._check_existence(name) or context.action_force:
     File 
"/usr/lib/ambari-agent/lib/ambari_commons/repo_manager/yum_manager.py", line 
279, in _check_existence
       return self.rpm_check_package_available(name)
     File 
"/usr/lib/ambari-agent/lib/ambari_commons/repo_manager/yum_manager.py", line 
333, in rpm_check_package_available
       if regex.match(package['name'].decode()):
   AttributeError: 'str' object has no attribute 'decode'`
   
   package['name'] is already unicode_string, no need to decode it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to