provisioning: Support older python for tests
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Mon, 10 Jul 2017 10:14:56 +0000 (12:14 +0200)
committerPhil Coval <philippe.coval@osg.samsung.com>
Wed, 23 Aug 2017 11:54:33 +0000 (11:54 +0000)
commit5885f5ed7282f0dd71a155439a3c3d1c50433452
treedac096d25b0748965dbcb75f19bf95f219f2af58
parentc670cf46cfa074923a728d448afa2aa391b73c2d
provisioning: Support older python for tests

Call psutil's process name() function if present,
then just access the name property.

It was observed on psutil 1.2.1 (Ubuntu 14.04.5)

  grep __version__ /usr/lib/python2.7/dist-packages/psutil/__init__.py
  __version__ = "1.2.1"

  scons TEST=1 resource/csdk/security/provisioning/
  scons: *** [out/linux/x86_64/release/resource/csdk/security/provisioning/unittest/start] TypeError : 'str' object is not callable
  Traceback (most recent call last):
  File "/usr/lib/scons/SCons/Action.py", line 1062, in execute
  result = self.execfunction(target=target, source=rsources, env=env)
  File ".../resource/csdk/security/provisioning/unittest/SConscript", line 125, in run_test
  kill_all()
  File ".../resource/csdk/security/provisioning/unittest/SConscript", line 118, in kill_all
  if proc.name() == server_bin:
  TypeError: 'str' object is not callable
  scons: building terminated because of errors.

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I0a9376bb007c49b9b980ed8798ff8a93882015d7
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21337
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: George Nash <george.nash@intel.com>
(cherry picked from commit ecccbb8206c0498008d023b73497675d2c31d38f)
resource/csdk/security/provisioning/unittest/SConscript