Support the new kiwi's environment api

Change-Id: Iaa769fba77e870303ff2da5da2457b09cac723eb