HYD-6971 Chroma externals unncessarily cloned
HYD-6971 Chroma externals unncessarily cloned

The chroma-externals repository is being unncessarily cloned because the
update_chroma-externals.py always issues a 'git submodule init'. This is
not necessary and whilst generally harmless leads git to sometimes
reinitialize the whole repository.

This patch changes the behaviour to follow the git documentation and
only do a 'git submodule init' when no chroma-externals repository 
exists.

 - Add selective 'git submodule init'
 - Move the main code into a main function to remove warnings about
   duplicate variable names within nested scopes.

Change-Id: Ic1f2c1b990e05b5fcaf997b3a3d63eaae6def3c0
Signed-off-by: Chris Gearing <149a3c4298d99c315fc555357d57d2940923ba5f@intel.com>
Reviewed-on: https://review.whamcloud.com/24389
Tested-by: Jenkins
Tested-by: Chroma Test User
Reviewed-by: Abiola Saraki <e374f88a50d2c210abe04dd90cffd0422b7fbd05@intel.com>
Reviewed-by: Tom Nabarro <27c585386b86ec0acfeeb448326cb9c60162db51@intel.com>
(cherry picked from commit efe5a11c65df1f2ce093b6e4526c0b74c2cf3afd)
Reviewed-on: https://review.whamcloud.com/24726
Reviewed-by: Joe Grund <5a0004131f5af71cc30270f318d2c30ba7aaa99a@intel.com>

intel-hpdd/intel-manager-for-lustre,intel-hpdd/intel-manager-for-lustre,intel-hpdd/intel-manager-for-lustre