printValues.extend([str(archiveBytes)]) selectedBytes = deviceObjectBackupUsage[0]['selectedBytes'] printValues.extend([str(selectedBytes)]) else: emptyBlock = "" printValues.extend([emptyBlock]) printValues.extend([emptyBlock]) printValues.extend([emptyBlock]) printValues.extend([emptyBlock]) userId = deviceObject[0]['userId'] printValues.extend([str(userId)]) userList = c42Lib.getUserById(userId) # userObject = userList['users'] username = userList['username'] printValues.extend([username.encode('utf-8')]) email = userList['email'] printValues.extend([email.encode('utf-8')]) firstName = userList['firstName'] printValues.extend([firstName.encode('utf-8')]) lastName = userList['lastName'] printValues.extend([lastName.encode('utf-8')]) logging.info(printValues)
orgId = 3 computers = c42Lib.getAllDevicesByOrg(orgId) for index, computer in enumerate(computers): printRow = [] computerId = computer['computerId'] printRow.extend([str(computerId)]) computerName = computer['name'] printRow.extend([computerName.encode('utf-8')]) userId = computer['userId'] printRow.extend([str(userId)]) userObject = c42Lib.getUserById(userId) username = userObject['username'] printRow.extend([username.encode('utf-8')]) email = userObject['email'] if email is None: printRow.extend([""]) else: printRow.extend([email.encode('utf-8')]) firstName = userObject['firstName'] if firstName is None: printRow.extend([""]) else: printRow.extend([firstName.encode('utf-8')])
computers = c42Lib.getAllDevicesByOrg(orgId) for index, computer in enumerate(computers): printRow = [] computerId = computer['computerId'] printRow.extend([str(computerId)]) computerName = computer['name'] printRow.extend([computerName.encode('utf-8')]) userId = computer['userId'] printRow.extend([str(userId)]) userObject = c42Lib.getUserById(userId) username = userObject['username'] printRow.extend([username.encode('utf-8')]) email = userObject['email'] if email is None: printRow.extend([""]) else: printRow.extend([email.encode('utf-8')]) firstName = userObject['firstName'] if firstName is None: printRow.extend([""]) else: printRow.extend([firstName.encode('utf-8')])