def checkDeprecatorOptions(options, parser): MarketplaceUtil.checkEndpointOption(options) if not P12Certificate.checkOptions(options): parser.error('Missing credentials. Please provide %s' % P12Certificate.optionString) if not options.email: parser.error('Missing email address. Please provide email of endorser')
def buildDeprecatorParser(parser): parser.usage = '''usage: %prog [options] image-id''' parser.description = ''' Create a new metadata entry for the given image that deprecates the image. The reason for the deprecation must be given. The image-id argument is the identifier of the image to deprecate. ''' MarketplaceUtil.addEndpointOption(parser) P12Certificate.addOptions(parser) parser.add_option('--email', dest='email', help='email address of endorser of metadata entry', default='') parser.add_option('--created', dest='created', help='date of metadata entry to be deprecated, latest entry will be deprecated if not provided', default='') parser.add_option('--reason', dest='reason', help='Comment to append to deprecation', default='This image has been deprecated', metavar='TEXT')