oB]c@sdZddlZddlZddlZddlmZmZmZdeZdZ ddZ dZ dZ d Zed krendS( sCCommandline utility to list the canonical cloud-id for an instance.iN(tINSTANCE_JSON_FILEtMETADATA_UNKNOWNtcanonical_cloud_ids/run/cloud-init/%sscloud-idc Cs|s!tjdtdd}n|jdddddtd d |jd d dddtd d |jdddtdtd dt|S(s*Build or extend an arg parser for the cloud-id utility. @param parser: Optional existing ArgumentParser instance representing the query subcommand which will be extended to support the args of this utility. @returns: ArgumentParser with proper argument configuration. tprogt descriptions/Report the canonical cloud-id for this instances-js--jsontactiont store_truetdefaultthelps5Report all standardized cloud-id information as json.s-ls--longs=Report extended cloud-id information as tab-delimited string.s-is--instance-datattypes.Path to instance-data.json file. Default is %s(targparsetArgumentParsertNAMEt add_argumenttFalsetstrtDEFAULT_INSTANCE_JSON(tparser((s:/usr/lib/python2.7/site-packages/cloudinit/cmd/cloud_id.pyt get_parsers   cCstjjd|dS(Ns ERROR: %s i(tsyststderrtwrite(tmsg((s:/usr/lib/python2.7/site-packages/cloudinit/cmd/cloud_id.pyterror+sc Cs)ytjt|j}WnEtk r=td|jStk rc}td|j|fSX|jdi}t|jdt |jdt |jdt }|jr||ds       !