Reduce code duplication
Reduce code duplication

Reduced source code by extracting duplicated code
(swift/cli/ringbuilder.py)

Change-Id: Ibd000df1dc9042e31b65b000199dff4a645e63b4

psachin/swift,psachin/swift,smerritt/swift,tipabu/swift,hurricanerix/swift,larsbutler/swift,openstack/swift,notmyname/swift,matthewoliver/swift,nadeemsyed/swift,notmyname/swift,smerritt/swift,nadeemsyed/swift,redbo/swift,swiftstack/swift,notmyname/swift,openstack/swift,openstack/swift,smerritt/swift,notmyname/swift,clayg/swift,hurricanerix/swift,matthewoliver/swift,psachin/swift,openstack/swift,smerritt/swift,clayg/swift,psachin/swift,swiftstack/swift,prashanthpai/swift,tipabu/swift,matthewoliver/swift,hurricanerix/swift,redbo/swift,prashanthpai/swift,tipabu/swift,clayg/swift,clayg/swift,swiftstack/swift,larsbutler/swift,matthewoliver/swift,tipabu/swift,hurricanerix/swift,nadeemsyed/swift,nadeemsyed/swift