Changed get_serial to be fully parameterized and return the serial

initialized.

Added a mapping of attributes between cloud-init and smartos.
This commit is contained in:
Ben Howard
2013-07-23 16:33:46 -06:00
parent 1c64c451c4
commit ce9b61a4ed
3 changed files with 44 additions and 37 deletions

View File

@@ -1744,13 +1744,14 @@ def get_mount_info(path, log=LOG):
lines = load_file(mountinfo_path).splitlines()
return parse_mount_info(path, lines, log)
def which(program):
# Return path of program for execution if found in path
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
fpath, fname = os.path.split(program)
if fpath:
_fpath, _ = os.path.split(program)
if _fpath:
if is_exe(program):
return program
else: