Posts by admin

Implementation of tree data structure in Python

Environment: Language used: python Version: 3.3.2 OS: Fedora 20 Data Structure used: Python lists Algorithm: Enter the height of the tree Type “Add” to add a node to the tree: First node should be root For any other value: Ask the user if its a left or a right node Find the possible parents (Note: For example if the height of the tree is 2 with elements 1,2,3. Where 1 is the root node and 2 is left node and 3 is the right node. For node 2 the possible parent is 1 which is at index 1.  ) List the possible parent and allow the user to select the parent Add the value to the node Enter ‘N’ to go to next level or ‘S’ to stay at the same level. (Note: If we take the same example as explained above then the first level is consist of 1 node i.e. root and the 2nd level is consist of child node 2 and 3 and so on) Type “Show” to view the current tree structure Type “exit” to exit the program Code Snippet: Implementing tree data structure using Python Python class buildTree (): """Please run the code with Python 3""" def __init__(self): """Class to build your own tree data structure""" self.root_status=False self.data_list=[] self.current_level=1 def possible_parents(self): result=[] for i in range(self.current_level,self.current_level*2): if self.data_list[i]!=-999: result.append(i) return result def addNode(self,node): """The following function will add the node on the left side of the parent""" val=self.possible_parents() if len(val)==0: print ("Error: No parent available. Cannot add any value as a left node") return else: print ("\n") print ("---List of possible parents:") print ("---Index: " + str([data for data in val])) print ("---Value: " + str([self.data_list[data] for data in val])) print ("---Note: The above list shows the indexes and the values of the possible parents. Select the index for which you want to assign the current node as parent") while True: input_user=int(input(">>")) if input_user not in val: print ("Error: Incorrect input. Try Again") else: break input_value=int(input("---Enter the value for {} node with parent {} >> ".format(node,self.data_list[input_user]))) try: if node=="Left": self.data_list[input_user*2]=input_value elif node=="Right": self.data_list[input_user*2+1]= input_value return except: print ("Error: No more space left. Please try again with a higher level/height value") return def changeLevel(self): #Asking the user if they want to continue on the same level or move to another level print ("---If you want to move to the next level type N or S...

Read More

Mellanox IB card failed to initialize after updating the bios to 3.3.2 on Dell C6145

Issue: After updating the bios firmware on Dell C6145, the Mellanox IB card failed to initialize. The dmesg shows the following error message: mlx4_core 0000:04:00.0: Failed to initialize queue pair table, aborting. mlx4_core 0000:04:00.0: PCI INT A disabled mlx4_core: probe of 0000:04:00.0 failed with error -16   Solution 1: Downgrade the bios firmware back to 3.0.0   Solution 2: 1) Reboot the server and press F2 during the post to go to bios menu 2) Under BIOS setup utility go to Exit menu and select Load Optimal Defaults and reboot the server. Note: Make sure to change the BMC settings as per your environment after the above steps. Resetting to default is going to change the BMC and boot settings back to...

Read More

RACADM command fails when importing iDRAC Licence

Issue: When importing the iDRAC license using racadm command it reports: root@theprojectbot:-# racadm license import -f mylicense.xml -c idrac.embedded.1 NOTE: This Integrated Dell Remote Access Controller does not support RACADM commands. Please contact Dell Customer Service to upgrade your version of iDRAC. The executed RACADM commands are not supported by the current version of Integrated Dell Remote Access Controller (iDRAC) in the system. To upgrade to latest version of iDRAC, contact Dell customer service.   Solution: Install packages srvadmin-idrac7 and srvadmin-idracadm7 If you have dell-omsa-repository configured then just run the following command: root@theprojectbot:-# yum install srvadmin-idrac7 srvadmin-idracadm7   Note: The above packages are different then srvadmin-idracadm and srvadmin-idrac Note: To check the installed packages on a rpm based OS, run the following command: root@theprojectbot:-# rpm -qva | grep...

Read More

How to gather controller logs on Power Edge 12G server from Life cycle controller

Instructions Step 1 Install USB flash drive in the server Step 2 Reboot the server and press F2 during the POST to enter BIOS Step 3 Under BIOS go to Device Settings > RAID Controller > Controller Management Step 4 Click Save Debug Log (Make sure you have a USB key plugged to the server) Step 5 On the next screen it will show up your USB device where you can save the...

Read More

How to control indication light on Dell CloudEdge Servers?

There are multiple ways to do it: Using BMC Tool Download the BMC tar package from following link: Extract the contents using command root@theprojectbot:-#tar –xvf bmc-2014-01-08.tgz Run the command: root@theprojectbot:-#./bmc id_led blink Note: Other command that can be used are: on|off|blink|fastblink Note: BMC web interface does have a Chassis indication option which shows the current status of the lights but it doesn’t work. Dell is aware of this issue and currently working on a firmware fix.   Using ipmitool The following ipmitool command will blink the indication light for 20 sec. root@theprojectbot:-#ipmitool chassis identify 20 Note:The above command can be use on most of the Dell & HP...

Read More
Page 1 of 212