コード例 #1
0
  BA_BUILD: Area where boot archive is put together (not used)

  MEDIA_DIR: Area where the media is put (not used)

  ZFS_SNAPSHOTS (variable number): List of snapshots to take as part of this
        checkpoint operation

  MESSAGE: Message to print while checkpointing

"""
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LENGTH = len(sys.argv)

if LENGTH < 8:
    raise Exception, (sys.argv[0] + ": At least 9 args are required:\n" +
                      "Reader socket, pkg_image area, tmp area, boot archive"
                      "build area,\n" + "media area, zfs dataset(s), message")

ZFS_SNAPSHOTS = sys.argv[6:LENGTH - 1]
MESSAGE = sys.argv[LENGTH - 1]

DC_LOG = setup_dc_logging()

for snapshot in ZFS_SNAPSHOTS:
    dc_ckp.shell_cmd("/usr/sbin/zfs rollback -r " + snapshot, DC_LOG)

DC_LOG.info(MESSAGE)

sys.exit(0)
コード例 #2
0
        return (status)

    # Execute the finalizer scripts
    status = finalizer_obj.execute()
    dc_log.info("Build completed " + time.asctime(time.localtime()))
    if (status != 0):
        dc_log.info("Build failed.")
    else:
        dc_log.info("Build is successful.")

    return (status)

if __name__ == "__main__":

    RET_VAL = 1 # this will be set to 0 if main_func() succeed
    DC_LOG = dcu.setup_dc_logging()

    # Pylint bug: See http://www.logilab.org/ticket/8764
    # pylint: disable-msg=C0321
    try:
        RET_VAL = main_func()
    except UsageError:
        RET_VAL = 2

    except SystemExit, e:
        DC_LOG.info(str(e))

    except Exception, ex:
        DC_LOG.exception(ex)

    finally: