Example #1
0
def get_additional_metadata():
  path = "dart_pox"
  return {
    'commit' : backtick("git rev-parse HEAD", cwd=path),
    'branch' : backtick("git rev-parse --abbrev-ref HEAD", cwd=path),
    'remote' : backtick("git remote show origin", cwd=path),
  }
Example #2
0
def dump_metadata(metadata_file, additional_metadata=None):
  with open(metadata_file, "w") as t:
    metadata = { 'timestamp' : timestamp_string(),
               'argv' : sys.argv,
               'user' : getpass.getuser(),
               'cwd' : os.getcwd(),
               'host' : {
                  'name' : socket.gethostname(),
                  'uptime' : backtick("uptime"),
                  'free' : backtick("exec 2>/dev/null free"),
                  'num_cores' : backtick("cat 2>/dev/null /proc/cpuinfo  | grep '^processor[[:space:]]' | wc -l"),
                  'cpu_info' : backtick("cat 2>/dev/null /proc/cpuinfo | grep 'model name[[:space:]]' | uniq | sed 's/.*://' | perl -pi -e 's/\s+/ /g'")
                },
               'sys' : {
                 'lsb_release' : backtick("exec 2>/dev/null lsb_release --description --short"),
                 'uname' : backtick("uname -a")
               },
               'modules' : {
                 module : { 'commit' : backtick("git rev-parse HEAD", cwd=path),
                            'branch' : backtick("git rev-parse --abbrev-ref HEAD", cwd=path),
                            'status' : backtick("git status", cwd=path),
                            'diff'   : backtick("git diff", cwd=path)
                          } for module, path in sts_modules
               },
               'additional_metadata': additional_metadata,
             }
    t.write(json.dumps(metadata, sort_keys=True, indent=2, separators=(',', ": ")) + "\n")
Example #3
0
def get_additional_metadata():
  path = "nox_classic/build/src"
  return {
    'commit' : backtick("git rev-parse HEAD", cwd=path),
    'branch' : backtick("git rev-parse --abbrev-ref HEAD", cwd=path),
    'remote' : backtick("git remote show origin", cwd=path),
  }
Example #4
0
def get_additional_metadata():
    path = "dart_pox"
    return {
        'commit': backtick("git rev-parse HEAD", cwd=path),
        'branch': backtick("git rev-parse --abbrev-ref HEAD", cwd=path),
        'remote': backtick("git remote show origin", cwd=path),
    }
Example #5
0
def get_additional_metadata():
    path = "nox_classic/build/src"
    return {
        'commit': backtick("git rev-parse HEAD", cwd=path),
        'branch': backtick("git rev-parse --abbrev-ref HEAD", cwd=path),
        'remote': backtick("git remote show origin", cwd=path),
    }
Example #6
0
def get_additional_metadata():
    path = "/home/rcs/vagrant_onosdev"
    return {
        "commit": backtick("git rev-parse HEAD", cwd=path),
        "branch": backtick("git rev-parse --abbrev-ref HEAD", cwd=path),
    }
Example #7
0
def get_additional_metadata():
  path = vagrant_dir + "/" + onos_dir
  return {
    'commit' : backtick("git rev-parse HEAD", cwd=path),
    'branch' : backtick("git rev-parse --abbrev-ref HEAD", cwd=path)
  }
Example #8
0
def get_additional_metadata():
    path = vagrant_dir + "/ONOS"
    return {
        "commit": backtick("git rev-parse HEAD", cwd=path),
        "branch": backtick("git rev-parse --abbrev-ref HEAD", cwd=path),
    }
Example #9
0
def get_additional_metadata():
  return {
    'commit' : backtick("git rev-parse HEAD", cwd="old_pox"),
    'branch' : backtick("git rev-parse --abbrev-ref HEAD", cwd="old_pox")
  }
Example #10
0
def get_additional_metadata():
  path = vagrant_dir + "/ONOS"
  return {
    'commit' : backtick("git rev-parse HEAD", cwd=path),
    'branch' : backtick("git rev-parse --abbrev-ref HEAD", cwd=path)
  }
Example #11
0
def get_additional_metadata():
    path = "nox_classic/build/src"
    return {
        "commit": backtick("git rev-parse HEAD", cwd=path),
        "branch": backtick("git rev-parse --abbrev-ref HEAD", cwd=path),
    }
Example #12
0
def get_additional_metadata():
    path = "/home/rcs/vagrant_onosdev"
    return {
        'commit': backtick("git rev-parse HEAD", cwd=path),
        'branch': backtick("git rev-parse --abbrev-ref HEAD", cwd=path)
    }