From 88c1be4b1b0caa38e4d9b6fc72b2c30d62cc96f4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 16 Sep 2011 13:00:02 +0200 Subject: [PATCH 01/22] add benchmark results Signed-off-by: Nico Schottelius --- ...011-09-16.benchmark-r815-no-control-socket | 63 + ...benchmark-r815-no-control-socket.dmidecode | 1373 +++++++++++++++++ 2 files changed, 1436 insertions(+) create mode 100644 doc/dev/logs/2011-09-16.benchmark-r815-no-control-socket create mode 100644 doc/dev/logs/2011-09-16.benchmark-r815-no-control-socket.dmidecode diff --git a/doc/dev/logs/2011-09-16.benchmark-r815-no-control-socket b/doc/dev/logs/2011-09-16.benchmark-r815-no-control-socket new file mode 100644 index 00000000..315ebf75 --- /dev/null +++ b/doc/dev/logs/2011-09-16.benchmark-r815-no-control-socket @@ -0,0 +1,63 @@ +48 core +model name : AMD Opteron(tm) Processor 6174 +128 GB RAM +Dell PowerEdge R815 + +root@sgs-r815-01:~/cdist-nutzung# grep "Total processing time for" deploy-all-benchmark-noikr13 +INFO: Total processing time for 1 host(s): 257.641541 +INFO: Total processing time for 2 host(s): 257.025783 +INFO: Total processing time for 3 host(s): 258.933088 +INFO: Total processing time for 4 host(s): 259.253074 +INFO: Total processing time for 5 host(s): 260.331896 +INFO: Total processing time for 6 host(s): 262.051349 +INFO: Total processing time for 7 host(s): 323.820878 +INFO: Total processing time for 8 host(s): 329.081856 +INFO: Total processing time for 9 host(s): 333.346278 +INFO: Total processing time for 10 host(s): 334.832419 +INFO: Total processing time for 11 host(s): 330.572375 +INFO: Total processing time for 12 host(s): 331.726628 +INFO: Total processing time for 13 host(s): 331.740591 +INFO: Total processing time for 14 host(s): 331.237139 +INFO: Total processing time for 15 host(s): 331.718861 +INFO: Total processing time for 16 host(s): 332.374645 +INFO: Total processing time for 17 host(s): 331.510445 +INFO: Total processing time for 18 host(s): 332.030743 +INFO: Total processing time for 19 host(s): 332.193198 +INFO: Total processing time for 20 host(s): 333.933765 +INFO: Total processing time for 21 host(s): 335.292953 +INFO: Total processing time for 22 host(s): 337.253608 +INFO: Total processing time for 23 host(s): 337.831493 +INFO: Total processing time for 24 host(s): 339.024737 +INFO: Total processing time for 25 host(s): 343.515044 +INFO: Total processing time for 26 host(s): 339.759678 +INFO: Total processing time for 27 host(s): 339.378998 +INFO: Total processing time for 28 host(s): 339.640378 +INFO: Total processing time for 29 host(s): 340.885614 +INFO: Total processing time for 30 host(s): 341.836923 +INFO: Total processing time for 31 host(s): 343.825758 +INFO: Total processing time for 32 host(s): 344.176089 +INFO: Total processing time for 33 host(s): 345.408518 +INFO: Total processing time for 34 host(s): 347.15322 +INFO: Total processing time for 35 host(s): 351.330649 +INFO: Total processing time for 36 host(s): 347.640758 +INFO: Total processing time for 37 host(s): 347.381126 +INFO: Total processing time for 38 host(s): 347.053406 +INFO: Total processing time for 39 host(s): 347.453166 +INFO: Total processing time for 40 host(s): 347.84804 +INFO: Total processing time for 41 host(s): 349.035272 +INFO: Total processing time for 42 host(s): 349.41507 +INFO: Total processing time for 43 host(s): 351.208072 +INFO: Total processing time for 44 host(s): 351.788401 +INFO: Total processing time for 45 host(s): 351.730259 +INFO: Total processing time for 46 host(s): 515.693497 +INFO: Total processing time for 47 host(s): 352.702677 +INFO: Total processing time for 48 host(s): 353.418003 +INFO: Total processing time for 49 host(s): 355.07111 +INFO: Total processing time for 50 host(s): 354.622388 +INFO: Total processing time for 51 host(s): 355.192521 +INFO: Total processing time for 52 host(s): 355.283238 +INFO: Total processing time for 53 host(s): 358.112329 +INFO: Total processing time for 54 host(s): 357.717426 +INFO: Total processing time for 55 host(s): 357.748707 +INFO: Total processing time for 56 host(s): 358.902118 +INFO: Total processing time for 57 host(s): 367.817594 diff --git a/doc/dev/logs/2011-09-16.benchmark-r815-no-control-socket.dmidecode b/doc/dev/logs/2011-09-16.benchmark-r815-no-control-socket.dmidecode new file mode 100644 index 00000000..f96db8b3 --- /dev/null +++ b/doc/dev/logs/2011-09-16.benchmark-r815-no-control-socket.dmidecode @@ -0,0 +1,1373 @@ +# dmidecode 2.9 +SMBIOS 2.6 present. +101 structures occupying 5955 bytes. +Table at 0xDF79C000. + +Handle 0xDA00, DMI type 218, 11 bytes +OEM-specific Type + Header and Data: + DA 0B 00 DA B0 00 17 00 0E 20 00 + +Handle 0x0000, DMI type 0, 24 bytes +BIOS Information + Vendor: Dell Inc. + Version: 1.0.0 + Release Date: 04/08/2010 + Address: 0xF0000 + Runtime Size: 64 kB + ROM Size: 4096 kB + Characteristics: + ISA is supported + PCI is supported + PNP is supported + BIOS is upgradeable + BIOS shadowing is allowed + Boot from CD is supported + Selectable boot is supported + EDD is supported + Japanese floppy for Toshiba 1.2 MB is supported (int 13h) + 5.25"/360 KB floppy services are supported (int 13h) + 5.25"/1.2 MB floppy services are supported (int 13h) + 3.5"/720 KB floppy services are supported (int 13h) + 8042 keyboard services are supported (int 9h) + Serial services are supported (int 14h) + CGA/mono video services are supported (int 10h) + ACPI is supported + USB legacy is supported + BIOS boot specification is supported + Function key-initiated network boot is supported + Targeted content distribution is supported + BIOS Revision: 1.0 + +Handle 0x0100, DMI type 1, 27 bytes +System Information + Manufacturer: Dell Inc. + Product Name: PowerEdge R815 + Version: Not Specified + Serial Number: HYGTS4J + UUID: 44454C4C-5900-1047-8054-C8C04F53344A + Wake-up Type: Power Switch + SKU Number: Not Specified + Family: Not Specified + +Handle 0x0200, DMI type 2, 9 bytes +Base Board Information + Manufacturer: Dell Inc. + Product Name: 06JC9T + Version: A00 + Serial Number: ..CN7475104Q0184. + +Handle 0x0300, DMI type 3, 21 bytes +Chassis Information + Manufacturer: Dell Inc. + Type: Rack Mount Chassis + Lock: Present + Version: Not Specified + Serial Number: HYGTS4J + Asset Tag: Not Specified + Boot-up State: Safe + Power Supply State: Safe + Thermal State: Safe + Security Status: Unknown + OEM Information: 0x00000000 + Height: 2 U + Number Of Power Cords: Unspecified + Contained Elements: 0 + +Handle 0x0400, DMI type 4, 40 bytes +Processor Information + Socket Designation: CPU1 + Type: Central Processor + Family: + Manufacturer: AMD + ID: 91 0F 10 00 FF FB 8B 17 + Version: AMD Opteron(tm) Processor 6174 + Voltage: 1.1 V + External Clock: 3200 MHz + Max Speed: 3600 MHz + Current Speed: 2200 MHz + Status: Populated, Enabled + Upgrade: + L1 Cache Handle: 0x0700 + L2 Cache Handle: 0x0701 + L3 Cache Handle: 0x0702 + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 12 + Core Enabled: 12 + Thread Count: 12 + Characteristics: + 64-bit capable + +Handle 0x0401, DMI type 4, 40 bytes +Processor Information + Socket Designation: CPU2 + Type: Central Processor + Family: + Manufacturer: AMD + ID: 91 0F 10 00 FF FB 8B 17 + Version: AMD Opteron(tm) Processor 6174 + Voltage: 1.1 V + External Clock: 3200 MHz + Max Speed: 3600 MHz + Current Speed: 2200 MHz + Status: Populated, Idle + Upgrade: + L1 Cache Handle: 0x0703 + L2 Cache Handle: 0x0704 + L3 Cache Handle: 0x0705 + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 12 + Core Enabled: 12 + Thread Count: 12 + Characteristics: + 64-bit capable + +Handle 0x0402, DMI type 4, 40 bytes +Processor Information + Socket Designation: CPU3 + Type: Central Processor + Family: + Manufacturer: AMD + ID: 91 0F 10 00 FF FB 8B 17 + Version: AMD Opteron(tm) Processor 6174 + Voltage: 1.1 V + External Clock: 3200 MHz + Max Speed: 3600 MHz + Current Speed: 2200 MHz + Status: Populated, Idle + Upgrade: + L1 Cache Handle: 0x0706 + L2 Cache Handle: 0x0707 + L3 Cache Handle: 0x0708 + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 12 + Core Enabled: 12 + Thread Count: 12 + Characteristics: + 64-bit capable + +Handle 0x0403, DMI type 4, 40 bytes +Processor Information + Socket Designation: CPU4 + Type: Central Processor + Family: + Manufacturer: AMD + ID: 91 0F 10 00 FF FB 8B 17 + Version: AMD Opteron(tm) Processor 6174 + Voltage: 1.1 V + External Clock: 3200 MHz + Max Speed: 3600 MHz + Current Speed: 2200 MHz + Status: Populated, Idle + Upgrade: + L1 Cache Handle: 0x0709 + L2 Cache Handle: 0x070A + L3 Cache Handle: 0x070B + Serial Number: Not Specified + Asset Tag: Not Specified + Part Number: Not Specified + Core Count: 12 + Core Enabled: 12 + Thread Count: 12 + Characteristics: + 64-bit capable + +Handle 0x0700, DMI type 7, 19 bytes +Cache Information + Socket Designation: Not Specified + Configuration: Enabled, Not Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 768 KB + Maximum Size: 768 KB + Supported SRAM Types: + Unknown + Installed SRAM Type: Unknown + Speed: Unknown + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: 2-way Set-associative + +Handle 0x0701, DMI type 7, 19 bytes +Cache Information + Socket Designation: Not Specified + Configuration: Enabled, Not Socketed, Level 2 + Operational Mode: Write Back + Location: Internal + Installed Size: 6144 KB + Maximum Size: 6144 KB + Supported SRAM Types: + Unknown + Installed SRAM Type: Unknown + Speed: Unknown + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: 16-way Set-associative + +Handle 0x0702, DMI type 7, 19 bytes +Cache Information + Socket Designation: Not Specified + Configuration: Enabled, Not Socketed, Level 3 + Operational Mode: Write Back + Location: Internal + Installed Size: 10240 KB + Maximum Size: 10240 KB + Supported SRAM Types: + Unknown + Installed SRAM Type: Unknown + Speed: Unknown + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: Other + +Handle 0x0703, DMI type 7, 19 bytes +Cache Information + Socket Designation: Not Specified + Configuration: Enabled, Not Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 768 KB + Maximum Size: 768 KB + Supported SRAM Types: + Unknown + Installed SRAM Type: Unknown + Speed: Unknown + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: 2-way Set-associative + +Handle 0x0704, DMI type 7, 19 bytes +Cache Information + Socket Designation: Not Specified + Configuration: Enabled, Not Socketed, Level 2 + Operational Mode: Write Back + Location: Internal + Installed Size: 6144 KB + Maximum Size: 6144 KB + Supported SRAM Types: + Unknown + Installed SRAM Type: Unknown + Speed: Unknown + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: 16-way Set-associative + +Handle 0x0705, DMI type 7, 19 bytes +Cache Information + Socket Designation: Not Specified + Configuration: Enabled, Not Socketed, Level 3 + Operational Mode: Write Back + Location: Internal + Installed Size: 10240 KB + Maximum Size: 10240 KB + Supported SRAM Types: + Unknown + Installed SRAM Type: Unknown + Speed: Unknown + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: Other + +Handle 0x0706, DMI type 7, 19 bytes +Cache Information + Socket Designation: Not Specified + Configuration: Enabled, Not Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 768 KB + Maximum Size: 768 KB + Supported SRAM Types: + Unknown + Installed SRAM Type: Unknown + Speed: Unknown + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: 2-way Set-associative + +Handle 0x0707, DMI type 7, 19 bytes +Cache Information + Socket Designation: Not Specified + Configuration: Enabled, Not Socketed, Level 2 + Operational Mode: Write Back + Location: Internal + Installed Size: 6144 KB + Maximum Size: 6144 KB + Supported SRAM Types: + Unknown + Installed SRAM Type: Unknown + Speed: Unknown + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: 16-way Set-associative + +Handle 0x0708, DMI type 7, 19 bytes +Cache Information + Socket Designation: Not Specified + Configuration: Enabled, Not Socketed, Level 3 + Operational Mode: Write Back + Location: Internal + Installed Size: 10240 KB + Maximum Size: 10240 KB + Supported SRAM Types: + Unknown + Installed SRAM Type: Unknown + Speed: Unknown + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: Other + +Handle 0x0709, DMI type 7, 19 bytes +Cache Information + Socket Designation: Not Specified + Configuration: Enabled, Not Socketed, Level 1 + Operational Mode: Write Back + Location: Internal + Installed Size: 768 KB + Maximum Size: 768 KB + Supported SRAM Types: + Unknown + Installed SRAM Type: Unknown + Speed: Unknown + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: 2-way Set-associative + +Handle 0x070A, DMI type 7, 19 bytes +Cache Information + Socket Designation: Not Specified + Configuration: Enabled, Not Socketed, Level 2 + Operational Mode: Write Back + Location: Internal + Installed Size: 6144 KB + Maximum Size: 6144 KB + Supported SRAM Types: + Unknown + Installed SRAM Type: Unknown + Speed: Unknown + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: 16-way Set-associative + +Handle 0x070B, DMI type 7, 19 bytes +Cache Information + Socket Designation: Not Specified + Configuration: Enabled, Not Socketed, Level 3 + Operational Mode: Write Back + Location: Internal + Installed Size: 10240 KB + Maximum Size: 10240 KB + Supported SRAM Types: + Unknown + Installed SRAM Type: Unknown + Speed: Unknown + Error Correction Type: Multi-bit ECC + System Type: Unified + Associativity: Other + +Handle 0x0800, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: DB-15 female + Port Type: Video Port + +Handle 0x0801, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: DB-15 female + Port Type: Video Port + +Handle 0x0802, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: Access Bus (USB) + Port Type: USB + +Handle 0x0803, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: Access Bus (USB) + Port Type: USB + +Handle 0x0804, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: Access Bus (USB) + Port Type: USB + +Handle 0x0805, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: Access Bus (USB) + Port Type: USB + +Handle 0x0806, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: Access Bus (USB) + Port Type: USB + +Handle 0x0807, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: Access Bus (USB) + Port Type: USB + +Handle 0x0808, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: INT_USB + Internal Connector Type: Access Bus (USB) + External Reference Designator: Not Specified + External Connector Type: None + Port Type: USB + +Handle 0x0809, DMI type 126, 9 bytes +Inactive + +Handle 0x080A, DMI type 126, 9 bytes +Inactive + +Handle 0x080B, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: RJ-45 + Port Type: Network Port + +Handle 0x080C, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: RJ-45 + Port Type: Network Port + +Handle 0x080D, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: RJ-45 + Port Type: Network Port + +Handle 0x080E, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: RJ-45 + Port Type: Network Port + +Handle 0x080F, DMI type 8, 9 bytes +Port Connector Information + Internal Reference Designator: Not Specified + Internal Connector Type: None + External Reference Designator: Not Specified + External Connector Type: DB-9 male + Port Type: Serial Port 16550A Compatible + +Handle 0x0900, DMI type 9, 17 bytes +System Slot Information + Designation: PCI1 + Type: x8 + Current Usage: Available + Length: Long + Characteristics: + 3.3 V is provided + PME signal is supported + +Handle 0x0901, DMI type 9, 17 bytes +System Slot Information + Designation: PCI2 + Type: x4 + Current Usage: Available + Length: Short + Characteristics: + 3.3 V is provided + PME signal is supported + +Handle 0x0902, DMI type 9, 17 bytes +System Slot Information + Designation: PCI3 + Type: x8 + Current Usage: Available + Length: Short + Characteristics: + 3.3 V is provided + PME signal is supported + +Handle 0x0903, DMI type 9, 17 bytes +System Slot Information + Designation: PCI4 + Type: x8 + Current Usage: Available + Length: Short + Characteristics: + 3.3 V is provided + PME signal is supported + +Handle 0x0904, DMI type 9, 17 bytes +System Slot Information + Designation: PCI5 + Type: x8 + Current Usage: Available + Length: Long + Characteristics: + 3.3 V is provided + PME signal is supported + +Handle 0x0905, DMI type 9, 17 bytes +System Slot Information + Designation: PCI6 + Type: x8 + Current Usage: Available + Length: Long + Characteristics: + 3.3 V is provided + PME signal is supported + +Handle 0x0A00, DMI type 10, 16 bytes +On Board Device 1 Information + Type: Video + Status: Enabled + Description: Embedded Matrox G200 Video +On Board Device 2 Information + Type: Ethernet + Status: Enabled + Description: Embedded Broadcom 5709C NIC 1 +On Board Device 3 Information + Type: Ethernet + Status: Enabled + Description: Embedded Broadcom 5709C NIC 2 +On Board Device 4 Information + Type: Ethernet + Status: Enabled + Description: Embedded Broadcom 5709C NIC 3 +On Board Device 5 Information + Type: Ethernet + Status: Enabled + Description: Embedded Broadcom 5709C NIC 4 +On Board Device 6 Information + Type: SAS Controller + Status: Enabled + Description: Integrated SAS Controller + +Handle 0x0B00, DMI type 11, 5 bytes +OEM Strings + String 1: Dell System + String 2: 5[0000] + +Handle 0x7E00, DMI type 126, 154 bytes +Inactive + +Handle 0x0C00, DMI type 12, 5 bytes +System Configuration Options + Option 1: NVRAM_CLR: Clear user settable NVRAM areas and set defaults + Option 2: PWRD_EN: Close to enable password + +Handle 0x0D00, DMI type 13, 22 bytes +BIOS Language Information + Installable Languages: 1 + en|US|iso8859-1 + Currently Installed Language: en|US|iso8859-1 + +Handle 0x1000, DMI type 16, 15 bytes +Physical Memory Array + Location: System Board Or Motherboard + Use: System Memory + Error Correction Type: Multi-bit ECC + Maximum Capacity: 256 GB + Error Information Handle: Not Provided + Number Of Devices: 32 + +Handle 0x1100, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 1 + Locator: DIMM_A1 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBE6 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1101, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 1 + Locator: DIMM_A2 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBC6 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1102, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 2 + Locator: DIMM_A3 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBFF + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1103, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 2 + Locator: DIMM_A4 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFC05 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1104, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 3 + Locator: DIMM_A5 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBB0 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1105, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 3 + Locator: DIMM_A6 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBED + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1106, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 4 + Locator: DIMM_A7 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFC06 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1107, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 4 + Locator: DIMM_A8 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBF7 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1108, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 5 + Locator: DIMM_B1 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFB92 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1109, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 5 + Locator: DIMM_B2 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBF4 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x110A, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 6 + Locator: DIMM_B3 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBC7 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x110B, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 6 + Locator: DIMM_B4 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFC26 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x110C, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 7 + Locator: DIMM_B5 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBE4 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x110D, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 7 + Locator: DIMM_B6 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBA4 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x110E, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 8 + Locator: DIMM_B7 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBB6 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x110F, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 8 + Locator: DIMM_B8 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFB0D + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1110, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 9 + Locator: DIMM_C1 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFC37 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1111, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 9 + Locator: DIMM_C2 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFC23 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1112, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 10 + Locator: DIMM_C3 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFB0E + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1113, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 10 + Locator: DIMM_C4 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFB04 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1114, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 11 + Locator: DIMM_C5 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBF6 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1115, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 11 + Locator: DIMM_C6 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFC21 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1116, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 12 + Locator: DIMM_C7 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFC28 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1117, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 12 + Locator: DIMM_C8 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBAC + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1118, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 13 + Locator: DIMM_D1 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBCD + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1119, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 13 + Locator: DIMM_D2 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBBD + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x111A, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 14 + Locator: DIMM_D3 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFAD0 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x111B, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 14 + Locator: DIMM_D4 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBBC + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x111C, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 15 + Locator: DIMM_D5 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFB2A + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x111D, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 15 + Locator: DIMM_D6 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBEB + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x111E, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 16 + Locator: DIMM_D7 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFADB + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x111F, DMI type 17, 28 bytes +Memory Device + Array Handle: 0x1000 + Error Information Handle: Not Provided + Total Width: 72 bits + Data Width: 64 bits + Size: 4096 MB + Form Factor: DIMM + Set: 16 + Locator: DIMM_D8 + Bank Locator: Not Specified + Type: + Type Detail: Synchronous + Speed: 1333 MHz (0.8 ns) + Manufacturer: 80CE80B380CE + Serial Number: 851CFBC9 + Asset Tag: 02101861 + Part Number: M393B5170EH1-CH9 + +Handle 0x1300, DMI type 19, 15 bytes +Memory Array Mapped Address + Starting Address: 0x00000000000 + Ending Address: 0x000DFFFFFFF + Range Size: 3584 MB + Physical Array Handle: 0x1000 + Partition Width: 0 + +Handle 0x1301, DMI type 19, 15 bytes +Memory Array Mapped Address + Starting Address: 0x00100000000 + Ending Address: 0x0201FFFFFFF + Range Size: 127488 MB + Physical Array Handle: 0x1000 + Partition Width: 0 + +Handle 0x2000, DMI type 32, 11 bytes +System Boot Information + Status: No errors detected + +Handle 0x2600, DMI type 38, 18 bytes +IPMI Device Information + Interface Type: KCS (Keyboard Control Style) + Specification Version: 2.0 + I2C Slave Address: 0x10 + NV Storage Device: Not Present + Base Address: 0x0000000000000CA8 (I/O) + Register Spacing: 32-bit Boundaries + +Handle 0x2900, DMI type 41, 11 bytes +Unknown Type + Header and Data: + 29 0B 00 29 01 85 01 00 00 01 00 + Strings: + Embedded NIC 1 + +Handle 0x2901, DMI type 41, 11 bytes +Unknown Type + Header and Data: + 29 0B 01 29 01 85 02 00 00 01 01 + Strings: + Embedded NIC 2 + +Handle 0x2902, DMI type 41, 11 bytes +Unknown Type + Header and Data: + 29 0B 02 29 01 85 03 00 00 02 00 + Strings: + Embedded NIC 3 + +Handle 0x2903, DMI type 41, 11 bytes +Unknown Type + Header and Data: + 29 0B 03 29 01 85 04 00 00 02 01 + Strings: + Embedded NIC 4 + +Handle 0x2904, DMI type 41, 11 bytes +Unknown Type + Header and Data: + 29 0B 04 29 01 8A 04 00 00 05 00 + Strings: + Integrated SAS + +Handle 0x2905, DMI type 126, 11 bytes +Inactive + +Handle 0x2906, DMI type 41, 11 bytes +Unknown Type + Header and Data: + 29 0B 06 29 01 83 04 00 00 0A 18 + Strings: + Embedded Video + +Handle 0xD000, DMI type 208, 16 bytes +OEM-specific Type + Header and Data: + D0 10 00 D0 02 00 FE 00 44 04 00 00 01 01 00 00 + +Handle 0xD200, DMI type 210, 12 bytes +OEM-specific Type + Header and Data: + D2 0C 00 D2 F8 03 04 03 06 80 04 05 + +Handle 0xD400, DMI type 212, 127 bytes +OEM-specific Type + Header and Data: + D4 7F 00 D4 70 00 71 00 00 10 2D 2E 42 00 11 FE + 01 43 00 11 FE 00 70 01 11 9F 20 6F 01 11 9F 00 + 00 00 11 9F 20 00 00 11 9F 00 31 40 11 FB 00 32 + 40 11 FB 04 9D 00 11 FD 02 9E 00 11 FD 00 9F 00 + 26 FE 01 A0 00 26 FE 00 28 40 26 DF 20 29 40 26 + DF 00 38 02 27 BF 40 39 02 27 BF 00 F1 01 27 FC + 01 F2 01 27 FC 02 F3 01 27 FC 03 F5 01 27 F3 04 + F6 01 27 F3 08 F7 01 27 F3 0C FF FF 00 00 00 + +Handle 0xD401, DMI type 212, 252 bytes +OEM-specific Type + Header and Data: + D4 FC 01 D4 70 00 71 00 03 40 5A 6D 5C 00 78 BF + 40 5D 00 78 BF 00 6C 01 57 FC 00 6B 01 57 FC 01 + 6A 01 57 FC 02 12 02 57 EF 00 11 02 57 EF 10 00 + 00 5B FB 04 00 00 5B FB 00 77 01 54 FC 00 78 01 + 54 FC 01 79 01 54 FC 02 7A 01 54 FC 03 33 40 54 + CF 00 34 40 54 CF 10 35 40 54 CF 20 36 40 54 CF + 30 1A 40 54 FB 04 1B 40 54 FB 00 1C 40 54 F7 08 + 1D 40 54 F7 00 43 40 58 DF 20 42 40 58 DF 00 24 + 40 58 BF 40 25 40 58 BF 00 6E 00 58 FC 01 2D 00 + 58 FC 02 DA 01 58 FC 03 22 40 58 EF 10 23 40 58 + EF 00 BB 00 58 F3 04 BC 00 58 F3 08 DB 01 58 F3 + 0C 2D 02 55 FE 01 2E 02 55 FE 00 D8 00 55 7F 80 + D9 00 55 7F 00 54 02 56 DF 00 57 02 56 DF 20 4D + 02 56 BF 00 4E 02 56 BF 40 2D 01 56 7F 80 2E 01 + 56 7F 00 00 C0 5C 00 0A 03 C0 67 00 05 83 00 76 + 00 00 84 00 77 00 00 FF FF 00 00 00 + +Handle 0xD402, DMI type 212, 177 bytes +OEM-specific Type + Header and Data: + D4 B1 02 D4 72 00 73 00 00 C0 DD DE D3 00 80 00 + 02 D4 00 82 00 02 D5 00 84 00 02 D6 00 86 00 02 + 4A 01 C6 BF 40 4B 01 C6 BF 00 00 90 AC 00 00 01 + 90 AD 00 00 00 00 C9 EB 14 00 00 C9 EF 10 DA 00 + C9 FB 04 00 00 C9 EB 00 00 00 C9 7F 00 00 00 C9 + 7F 80 CA 00 C9 FC 00 CB 00 C9 FC 01 00 00 C9 FC + 02 DE 00 E3 FE 01 26 40 C2 FE 01 27 40 C2 FE 00 + 17 01 CA FE 00 18 01 CA FE 01 00 00 CA FD 00 00 + 00 CA FD 02 35 01 CB FC 00 37 01 CB FC 01 02 40 + C6 DF 00 01 40 C6 DF 20 FC 01 C5 BF 00 FD 01 C5 + BF 40 00 00 C5 7F 80 00 00 C5 7F 00 FF FF 00 00 + 00 + +Handle 0xD403, DMI type 212, 132 bytes +OEM-specific Type + Header and Data: + D4 84 03 D4 72 00 73 00 00 C0 DD DE 32 02 C0 07 + 10 31 02 C0 07 20 6F 02 C0 07 30 70 02 C0 07 40 + 71 02 C0 07 50 72 02 C0 07 60 6E 02 C0 07 00 00 + 00 C6 FE 00 00 00 C6 FE 01 40 01 C7 EF 10 41 01 + C7 EF 00 C4 01 D0 FE 00 C5 01 D0 FE 01 73 01 D0 + BF 40 74 01 D0 BF 00 AB 02 D0 DF 20 AC 02 D0 DF + 00 A9 02 D0 EF 10 AA 02 D0 EF 00 6A 02 DB FE 00 + 6B 02 DB FE 01 7B 02 DB FD 00 7C 02 DB FD 02 FF + FF 00 00 00 + +Handle 0xD800, DMI type 216, 9 bytes +OEM-specific Type + Header and Data: + D8 09 00 D8 01 02 01 00 00 + Strings: + MATROX + VGA/VBE BIOS, Version V3.8WO + +Handle 0xDE00, DMI type 222, 16 bytes +OEM-specific Type + Header and Data: + DE 10 00 DE 01 08 FF FF 00 00 00 00 00 00 00 01 + +Handle 0x7F00, DMI type 127, 4 bytes +End Of Table + From 1b0d85dcbe0ceac565c17109c4f9fa2f813f72a4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 16 Sep 2011 15:29:56 +0200 Subject: [PATCH 02/22] link type emulator to ourself Signed-off-by: Nico Schottelius --- bin/cdist | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bin/cdist b/bin/cdist index 39452352..e28a14c4 100755 --- a/bin/cdist +++ b/bin/cdist @@ -367,7 +367,7 @@ class Cdist: def link_type_to_emulator(self): """Link type names to cdist-type-emulator""" for type in self.list_types(): - source = os.path.join(self.lib_dir, "cdist-type-emulator") + source = sys.argv[0] destination = os.path.join(self.bin_dir, type) log.debug("Linking %s to %s", source, destination) os.symlink(source, destination) @@ -637,6 +637,18 @@ def emulator(): """Emulate type commands (i.e. __file and co)""" type = os.path.basename(sys.argv[0]) + + parser = argparse.ArgumentParser(add_help=False) + + print("Oh, noe") + sys.exit(1) + + # Setup optional parameters + # Setup required parameters + # Setup positional parameter, if not singleton + + + def commandline(): """Parse command line""" # Construct parser others can reuse From f720ce92435b126f65241d1497d1f53a8244494f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 16 Sep 2011 15:46:02 +0200 Subject: [PATCH 03/22] ++todo Signed-off-by: Nico Schottelius --- bin/cdist | 14 +++++++++----- doc/dev/todo/niconext | 8 ++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/bin/cdist b/bin/cdist index e28a14c4..ee5b72c1 100755 --- a/bin/cdist +++ b/bin/cdist @@ -454,11 +454,13 @@ class Cdist: env['__global'] = self.out_dir # Legacy stuff to make cdist-type-emulator work - env['__cdist_conf_dir'] = self.conf_dir env['__cdist_core_dir'] = os.path.join(self.base_dir, "core") env['__cdist_local_base_dir'] = self.temp_dir env['__cdist_manifest'] = self.initial_manifest + # Submit information to new type emulator + env['__cdist_type_base_dir'] = self.type_base_dir + # Other environment stuff if extra_env: env.update(extra_env) @@ -636,17 +638,19 @@ def install(args): def emulator(): """Emulate type commands (i.e. __file and co)""" type = os.path.basename(sys.argv[0]) - + type_dir = os.environ['__cdist_type_base_dir'] parser = argparse.ArgumentParser(add_help=False) - print("Oh, noe") - sys.exit(1) - # Setup optional parameters + if os.path.isfile(os.path.join(type_dir, "parameter", "optional"): + __cdist_type_base_dir # Setup required parameters # Setup positional parameter, if not singleton + print("Oh, noe") + sys.exit(1) + def commandline(): diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index deab8801..3ec5ae96 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -22,6 +22,14 @@ - Remove man1/cdist-type-emulator.text - Remove the PATH=... part from the README + - basename(argv0) == type + - how to get to type dir? + - dependent on -c to cdist! + - submit via internal env! + - need to build parameter parser + - need to read file + - refactor list_object_requirements + - Allow manifest to be read from stdin - Create new video for cdist 2.0.0 http://www.youtube.com/watch?v=PRMjzy48eTI From 75510d88c925f4fbae3f931195bc3a354b2e633f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 16 Sep 2011 16:08:25 +0200 Subject: [PATCH 04/22] first new type emulator parameter support in cdist Signed-off-by: Nico Schottelius --- bin/cdist | 55 +++++++++++++++++++++++++------------------ doc/dev/todo/niconext | 5 ++-- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/bin/cdist b/bin/cdist index ee5b72c1..34c89d86 100755 --- a/bin/cdist +++ b/bin/cdist @@ -62,6 +62,21 @@ VERSION = "2.0.0" logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s') log = logging.getLogger() + +def file_to_list(filename): + """Return list from \n seperated file""" + if os.path.isfile(filename): + file_fd = open(filename, "r") + lines = file_fd.readlines() + file_fd.close() + + # Remove \n from all lines + lines = map(lambda s: s.strip(), lines) + else: + lines = [] + + return lines + class TypeEmulator: def __init__(self, name): self.name = name @@ -467,28 +482,11 @@ class Cdist: self.shell_run_or_debug_fail(manifest, [manifest], env=env) - def list_object_requirements(self, cdist_object): - """Return list of requirements for specific object""" - file=os.path.join(self.object_dir(cdist_object), "require") - - if os.path.isfile(file): - file_fd = open(file, "r") - requirements = file_fd.readlines() - file_fd.close() - - # Remove \n from all lines - requirements = map(lambda s: s.strip(), requirements) - - log.debug("Requirements for %s: %s", cdist_object, requirements) - else: - requirements = [] - - return requirements - def object_run(self, cdist_object, mode): """Run gencode or code for an object""" log.debug("Running %s from %s", mode, cdist_object) - requirements = self.list_object_requirements(cdist_object) + file=os.path.join(self.object_dir(cdist_object), "require") + requirements = file_to_list(file) type = self.get_type_from_object(cdist_object) for requirement in requirements: @@ -638,21 +636,32 @@ def install(args): def emulator(): """Emulate type commands (i.e. __file and co)""" type = os.path.basename(sys.argv[0]) - type_dir = os.environ['__cdist_type_base_dir'] + type_dir = os.path.join(os.environ['__cdist_type_base_dir'], type) + param_dir = os.path.join(type_dir, "parameter") parser = argparse.ArgumentParser(add_help=False) # Setup optional parameters - if os.path.isfile(os.path.join(type_dir, "parameter", "optional"): - __cdist_type_base_dir + for parameter in file_to_list(os.path.join(param_dir, "optional")): + argument = "--" + parameter + print("Adding" + argument) + parser.add_argument(argument, action='store', required=False) + # Setup required parameters + for parameter in file_to_list(os.path.join(param_dir, "required")): + argument = "--" + parameter + print("Adding" + argument) + parser.add_argument(argument, action='store', required=True) + # Setup positional parameter, if not singleton + # And finally verify parameter + args = parser.parse_args(sys.argv[1:]) + print("Oh, noe") sys.exit(1) - def commandline(): """Parse command line""" # Construct parser others can reuse diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 3ec5ae96..83b18dd9 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -27,8 +27,9 @@ - dependent on -c to cdist! - submit via internal env! - need to build parameter parser - - need to read file - - refactor list_object_requirements + + Test: + __cdist_type_base_dir=$(pwd -P)/conf/type __file - Allow manifest to be read from stdin - Create new video for cdist 2.0.0 From b4a431a03b5a406c8d1ff374dce60256c403e4f2 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 16 Sep 2011 17:08:39 +0200 Subject: [PATCH 05/22] more todo for soon Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 83b18dd9..c9fd6c0d 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,6 +1,6 @@ - Initial install support - - setup $__install = "" for - manifest(s) + - setup $__install = "yes" for + manifest(s), gencode-* - run standard manifest (?) - creates initial objects @@ -11,6 +11,8 @@ - run all other manifests - creates all objects - what about type explorer? + - do not run, create empty output (types should be able + to handle this!) - Support parallel execution - and maximum number of parallel runs (-p X) From 6485299a7cd2a9cbdfa10d6e52b23bd8f7d22536 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 16 Sep 2011 17:08:59 +0200 Subject: [PATCH 06/22] prepare source records, cleanup Signed-off-by: Nico Schottelius --- bin/cdist | 57 ++++++++++++++++++++----------------------------------- 1 file changed, 21 insertions(+), 36 deletions(-) diff --git a/bin/cdist b/bin/cdist index 34c89d86..032b078d 100755 --- a/bin/cdist +++ b/bin/cdist @@ -77,37 +77,6 @@ def file_to_list(filename): return lines -class TypeEmulator: - def __init__(self, name): - self.name = name - self.type = os.path.basename(name) - - - def type_emulator(self): - type = basename(sys.argv[0]) - - type_is_singleton(type) - - # Check object id - - # Prevent double slash if id begins with / - - # Record parameter: opt_file="${opt#--}" - # [ $# -ge 1 ] || __cdist_usage "Missing value for $opt" - # echo "${value}" > "${__cdist_parameter_dir}/${opt_file}" - - # Record requirements - # echo $requirement >> "$(__cdist_object_require "$__cdist_object_self")" - - # Ensure required parameters are given - # Ensure that only optional or required parameters are given - # [ "$is_valid" ] || __cdist_usage "Unknown parameter $parameter" - - # Merge object (creating twice with the same parameter + requirements == allowed) - - # diff -ru "${__cdist_new_object_dir}/${__cdist_name_parameter} - # # Add "I was here message" - # _cdist_object_source_add "${__cdist_object_dir}" class Cdist: """Cdist main class to hold arbitrary data""" @@ -471,9 +440,9 @@ class Cdist: # Legacy stuff to make cdist-type-emulator work env['__cdist_core_dir'] = os.path.join(self.base_dir, "core") env['__cdist_local_base_dir'] = self.temp_dir - env['__cdist_manifest'] = self.initial_manifest # Submit information to new type emulator + env['__cdist_manifest'] = manifest env['__cdist_type_base_dir'] = self.type_base_dir # Other environment stuff @@ -644,22 +613,38 @@ def emulator(): # Setup optional parameters for parameter in file_to_list(os.path.join(param_dir, "optional")): argument = "--" + parameter - print("Adding" + argument) parser.add_argument(argument, action='store', required=False) # Setup required parameters for parameter in file_to_list(os.path.join(param_dir, "required")): argument = "--" + parameter - print("Adding" + argument) parser.add_argument(argument, action='store', required=True) # Setup positional parameter, if not singleton + if not os.path.isfile(os.path.join(type_dir, "singleton")): + parser.add_argument("object_id", nargs=1) + else: + print("singleton") + # And finally verify parameter args = parser.parse_args(sys.argv[1:]) - print("Oh, noe") - sys.exit(1) + # Record parameter + # wh + print(args) + + # Record requirements + if "__require" in os.environ: + requirements = os.environ['__require'] + + # Merge / mv object into tree + + # Record / Append source + source = os.environ['__cdist_manifest'] + # write to .source? + + # sys.exit(1) def commandline(): From 5cefeb25fc89cb25eb40853ba898fc46978bf0b8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 16 Sep 2011 18:26:18 +0200 Subject: [PATCH 07/22] +/- todo, improve argument handling Signed-off-by: Nico Schottelius --- bin/cdist | 14 ++++++++++++-- doc/dev/todo/niconext | 26 +++++++++++--------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/bin/cdist b/bin/cdist index 032b078d..8d5e9342 100755 --- a/bin/cdist +++ b/bin/cdist @@ -434,6 +434,7 @@ class Cdist: env = os.environ.copy() env['PATH'] = self.bin_dir + ":" + env['PATH'] + # Information required in every manifest env['__target_host'] = self.target_host env['__global'] = self.out_dir @@ -630,10 +631,19 @@ def emulator(): # And finally verify parameter args = parser.parse_args(sys.argv[1:]) - # Record parameter - # wh + object_id = args.object_id + + del args.object_id print(args) + # Record parameter + params = vars(args) + for param in params: + value = getattr(args, param) + if value: + print("Writing " + param + " = " + value) + + # Record requirements if "__require" in os.environ: requirements = os.environ['__require'] diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index c9fd6c0d..bd30c08d 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,3 +1,14 @@ +- Rewrite cdist-type-emulator + - Remove legacy code in cdist + - Remove cdist-config + - Remove man1/cdist-type-emulator.text + - Remove the PATH=... part from the README + + - how to access output dir? + + Test: + __cdist_type_base_dir=$(pwd -P)/conf/type __file + - Initial install support - setup $__install = "yes" for manifest(s), gencode-* @@ -18,21 +29,6 @@ - and maximum number of parallel runs (-p X) - error handling / report failed hosts -- Rewrite cdist-type-emulator - - Remove legacy code in cdist - - Remove cdist-config - - Remove man1/cdist-type-emulator.text - - Remove the PATH=... part from the README - - - basename(argv0) == type - - how to get to type dir? - - dependent on -c to cdist! - - submit via internal env! - - need to build parameter parser - - Test: - __cdist_type_base_dir=$(pwd -P)/conf/type __file - - Allow manifest to be read from stdin - Create new video for cdist 2.0.0 http://www.youtube.com/watch?v=PRMjzy48eTI From 8838d5df11ce3febbeb6d55b993804c236294683 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 16 Sep 2011 19:06:43 +0200 Subject: [PATCH 08/22] begin writing params Signed-off-by: Nico Schottelius --- bin/cdist | 22 +++++++++++++++++----- doc/dev/todo/niconext | 1 + 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/bin/cdist b/bin/cdist index 8d5e9342..ad8add02 100755 --- a/bin/cdist +++ b/bin/cdist @@ -608,6 +608,7 @@ def emulator(): type = os.path.basename(sys.argv[0]) type_dir = os.path.join(os.environ['__cdist_type_base_dir'], type) param_dir = os.path.join(type_dir, "parameter") + global_dir = os.environ['__global'] parser = argparse.ArgumentParser(add_help=False) @@ -625,23 +626,34 @@ def emulator(): if not os.path.isfile(os.path.join(type_dir, "singleton")): parser.add_argument("object_id", nargs=1) - else: - print("singleton") # And finally verify parameter args = parser.parse_args(sys.argv[1:]) - object_id = args.object_id + # Setup object_id + if os.path.isfile(os.path.join(type_dir, "singleton")): + object_id = "singleton" + else: + object_id = args.object_id + del args.object_id - del args.object_id print(args) + print(object_id) + param_out_dir = os.path.join(global_dir, type, + object_id, DOT_CDIST, "parameter") + # Record parameter params = vars(args) for param in params: value = getattr(args, param) if value: - print("Writing " + param + " = " + value) + file = os.path.join(param_out_dir, param) + print(file + "<-" + param + " = " + value) + param_fd = open(file) + param_fd.writelines(value) + param_fd.close() + # Record requirements diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index bd30c08d..a74862f4 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -24,6 +24,7 @@ - what about type explorer? - do not run, create empty output (types should be able to handle this!) + via __global/ - Support parallel execution - and maximum number of parallel runs (-p X) From a9bcec7fbe9f4ca7ad901cfc3e14dc6a640640cc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 18 Sep 2011 20:50:07 +0200 Subject: [PATCH 09/22] also catch OSError from subprocess Signed-off-by: Nico Schottelius --- bin/cdist | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/cdist b/bin/cdist index f7ad2f72..fce96099 100755 --- a/bin/cdist +++ b/bin/cdist @@ -198,6 +198,8 @@ class Cdist: script_fd.close() self.exit_error("Command failed (shell): " + " ".join(*args)) + except OSError as error: + self.exit_error(" ".join(*args) + ": " + error.args[1]) def run_or_fail(self, *args, **kargs): if "remote" in kargs: @@ -211,6 +213,9 @@ class Cdist: subprocess.check_call(*args, **kargs) except subprocess.CalledProcessError: self.exit_error("Command failed: " + " ".join(*args)) + except OSError as error: + self.exit_error(" ".join(*args) + ": " + error.args[1]) + def remove_remote_dir(self, destination): self.run_or_fail(["rm", "-rf", destination], remote=True) From 606c47906708731f8b351ff5249e71d185d7d4b6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 18 Sep 2011 20:57:13 +0200 Subject: [PATCH 10/22] changes for 2.0.1 Signed-off-by: Nico Schottelius --- doc/changelog | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/changelog b/doc/changelog index 50409cac..cc6aa78b 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,6 +1,9 @@ -2.0.0: +2.0.1: + * Bugfix cdist: Always print source of error in case of exec errors + +2.0.0: 2011-09-16 * New Type: __package_rubygem (Chase Allen James) - * __self replaced by __object_fq (or so) + * __self replaced by __object_fq * Rewrote cdist in Python 1.7.1: 2011-07-26 From e0030947e4b3bd6e01264919b27a81dc79a79be7 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 18 Sep 2011 21:04:23 +0200 Subject: [PATCH 11/22] document TMP variable Signed-off-by: Nico Schottelius --- doc/man/man1/cdist.text | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/man/man1/cdist.text b/doc/man/man1/cdist.text index 5a45b8c1..c43e4e1c 100644 --- a/doc/man/man1/cdist.text +++ b/doc/man/man1/cdist.text @@ -82,6 +82,14 @@ cdist --version -------------------------------------------------------------------------------- +ENVIRONMENT +----------- +TMP:: + Setup the base directory for the temporary directory. + See http://docs.python.org/py3k/library/tempfile.html for + more information. This is rather useful, if the standard + directory used does not allow executables. + SEE ALSO -------- - cdist(7) From 9de1d9ce2017e27776fe817a8a55952b769586ea Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 19 Sep 2011 00:24:17 +0200 Subject: [PATCH 12/22] write parameters to object Signed-off-by: Nico Schottelius --- bin/cdist | 46 +++++++++++++++++++++++++++---------------- doc/dev/todo/niconext | 2 ++ 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/bin/cdist b/bin/cdist index 9094a5f8..1d130eca 100755 --- a/bin/cdist +++ b/bin/cdist @@ -77,6 +77,9 @@ def file_to_list(filename): return lines +def exit_error(*args): + log.error(*args) + sys.exit(1) class Cdist: """Cdist main class to hold arbitrary data""" @@ -144,10 +147,6 @@ class Cdist: shutil.rmtree(self.cache_dir) shutil.move(self.temp_dir, self.cache_dir) - def exit_error(self, *args): - log.error(*args) - sys.exit(1) - def remote_mkdir(self, directory): """Create directory on remote side""" self.run_or_fail(["mkdir", "-p", directory], remote=True) @@ -182,9 +181,9 @@ class Cdist: print(script_fd.read()) script_fd.close() - self.exit_error("Command failed (shell): " + " ".join(*args)) + exit_error("Command failed (shell): " + " ".join(*args)) except OSError as error: - self.exit_error(" ".join(*args) + ": " + error.args[1]) + exit_error(" ".join(*args) + ": " + error.args[1]) def run_or_fail(self, *args, **kargs): if "remote" in kargs: @@ -197,9 +196,9 @@ class Cdist: try: subprocess.check_call(*args, **kargs) except subprocess.CalledProcessError: - self.exit_error("Command failed: " + " ".join(*args)) + exit_error("Command failed: " + " ".join(*args)) except OSError as error: - self.exit_error(" ".join(*args) + ": " + error.args[1]) + exit_error(" ".join(*args) + ": " + error.args[1]) def remove_remote_dir(self, destination): @@ -365,7 +364,7 @@ class Cdist: """Run global explorers""" explorers = self.list_global_explorers() if(len(explorers) == 0): - self.exit_error("No explorers found in", self.global_explorer_dir) + exit_error("No explorers found in", self.global_explorer_dir) self.transfer_global_explorers() for explorer in explorers: @@ -639,14 +638,23 @@ def emulator(): if os.path.isfile(os.path.join(type_dir, "singleton")): object_id = "singleton" else: - object_id = args.object_id + object_id = args.object_id[0] del args.object_id - print(args) + # FIXME: / hardcoded - better portable solution available? + if object_id[0] == '/': + object_id = object_id[1:] - print(object_id) - param_out_dir = os.path.join(global_dir, type, - object_id, DOT_CDIST, "parameter") + log.debug(args) + + object_dir = os.path.join(global_dir, type, + object_id, DOT_CDIST) + param_out_dir = os.path.join(object_dir, "parameter") + + try: + os.makedirs(param_out_dir, exist_ok=True) + except OSError as error: + exit_error(param_out_dir + ": " + error.args[1]) # Record parameter params = vars(args) @@ -654,16 +662,19 @@ def emulator(): value = getattr(args, param) if value: file = os.path.join(param_out_dir, param) - print(file + "<-" + param + " = " + value) - param_fd = open(file) + log.debug(file + "<-" + param + " = " + value) + param_fd = open(file, "w") param_fd.writelines(value) param_fd.close() - # Record requirements if "__require" in os.environ: requirements = os.environ['__require'] + print(object_id + ":Writing requirements: " + requirements) + require_fd = open(os.path.join(object_dir, "require"), "a") + require_fd.writelines(requirements.split(" ")) + require_fd.close() # Merge / mv object into tree @@ -672,6 +683,7 @@ def emulator(): # write to .source? # sys.exit(1) + print("Finished " + type + "/" + object_id + repr(params)) def commandline(): diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index a74862f4..231489e9 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -33,3 +33,5 @@ - Allow manifest to be read from stdin - Create new video for cdist 2.0.0 http://www.youtube.com/watch?v=PRMjzy48eTI + +- Setup __debug, if -d is given, so other tools can reuse it From b7b48414e1b3a2684dc731208bc0924671f01a4b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 19 Sep 2011 00:32:33 +0200 Subject: [PATCH 13/22] use subdirectory, record source Signed-off-by: Nico Schottelius --- bin/cdist | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/cdist b/bin/cdist index 1d130eca..84ebd5f2 100755 --- a/bin/cdist +++ b/bin/cdist @@ -647,7 +647,7 @@ def emulator(): log.debug(args) - object_dir = os.path.join(global_dir, type, + object_dir = os.path.join(global_dir, "object", type, object_id, DOT_CDIST) param_out_dir = os.path.join(object_dir, "parameter") @@ -676,11 +676,13 @@ def emulator(): require_fd.writelines(requirements.split(" ")) require_fd.close() - # Merge / mv object into tree + # FIXME: Merge / mv object into tree # Record / Append source source = os.environ['__cdist_manifest'] - # write to .source? + source_fd = open(os.path.join(object_dir, "source"), "a") + source_fd.writelines(source) + source_fd.close() # sys.exit(1) print("Finished " + type + "/" + object_id + repr(params)) From 4e8f99b01daa49daa80a10da1546beeda799d23f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 19 Sep 2011 00:36:35 +0200 Subject: [PATCH 14/22] almost completly implemented type emulator in python Signed-off-by: Nico Schottelius --- bin/cdist | 1 + lib/cdist-type-emulator | 182 ---------------------------------------- 2 files changed, 1 insertion(+), 182 deletions(-) delete mode 100755 lib/cdist-type-emulator diff --git a/bin/cdist b/bin/cdist index 84ebd5f2..57c889f1 100755 --- a/bin/cdist +++ b/bin/cdist @@ -645,6 +645,7 @@ def emulator(): if object_id[0] == '/': object_id = object_id[1:] + # FIXME: verify object id log.debug(args) object_dir = os.path.join(global_dir, "object", type, diff --git a/lib/cdist-type-emulator b/lib/cdist-type-emulator deleted file mode 100755 index 8ff190ad..00000000 --- a/lib/cdist-type-emulator +++ /dev/null @@ -1,182 +0,0 @@ -#!/bin/sh -# -# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# Wrapper script that generates cconfig from arguments -# -# This script will be called everytime the manifest decides to create -# a new type -# - -. cdist-config -set -u - -################################################################################ -# Prepare object and type -# - -__cdist_type="$__cdist_myname" - -# Find out whether type is a singleton or regular type -if [ -f "$(__cdist_type_singleton "$__cdist_type")" ]; then - __cdist_object_id="$__cdist_name_singleton" -else - [ $# -ge 1 ] || __cdist_usage " " - __cdist_object_id="$1"; shift -fi - -# Verify object id -__cdist_object_id_sane=$(echo "$__cdist_object_id" | grep "^${__cdist_sane_regexp}\$") -if [ -z "$__cdist_object_id_sane" ]; then - __cdist_usage "Insane object id, ${__cdist_object_id}." -fi - -# Prevent double slash if id begins with / -if [ "$(echo $__cdist_object_id | grep "^/")" ]; then - __cdist_object_self="${__cdist_type}${__cdist_object_id}" -else - __cdist_object_self="${__cdist_type}/${__cdist_object_id}" -fi -################################################################################ -# Internal quirks -# - -# Append id for error messages -__cdist_myname="$__cdist_myname ($__cdist_object_id)" - -################################################################################ -# Create object in tmpdir first -# - -# Save original destination -__cdist_out_object_dir_orig="$__cdist_out_object_dir" - -# Store to tmp now -__cdist_out_object_dir="$__cdist_tmp_dir" - -__cdist_new_object_dir="$(__cdist_object_dir "$__cdist_object_self")" - -# Initialise object -mkdir -p "${__cdist_new_object_dir}" - -# Record parameter -__cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object_self")" -mkdir -p "${__cdist_parameter_dir}" - -while [ $# -gt 0 ]; do - opt="$1"; shift - - echo "$opt" | grep -q "^--${__cdist_sane_regexp}\$" || \ - __cdist_usage "Provide sane options" - - opt_file="${opt#--}" - - [ $# -ge 1 ] || __cdist_usage "Missing value for $opt" - - value="$1"; shift - - echo "${value}" > "${__cdist_parameter_dir}/${opt_file}" -done - -# Record requirements -# it's fine, if it's not set -set +u -for requirement in $require; do - echo $requirement >> "$(__cdist_object_require "$__cdist_object_self")" - __cdist_echo info "Recording requirement $requirement" -done -set -u - -################################################################################ -# Check newly created object -# - -# -# Ensure required parameters are given -# -if [ -f "$(__cdist_type_parameter_required "$__cdist_type")" ]; then - while read required; do - if [ ! -f "${__cdist_parameter_dir}/${required}" ]; then - __cdist_usage "Missing required parameter $required" - fi - done < "$(__cdist_type_parameter_required "$__cdist_type")" -fi - -# -# Ensure that only optional or required parameters are given -# - -if [ -f "$(__cdist_type_parameter_optional "$__cdist_type")" ]; then - cat "$(__cdist_type_parameter_optional "$__cdist_type")" > \ - "$__cdist_tmp_file" -fi - -if [ -f "$(__cdist_type_parameter_required "$__cdist_type")" ]; then - cat "$(__cdist_type_parameter_required "$__cdist_type")" >> \ - "$__cdist_tmp_file" -fi - -cd "$__cdist_parameter_dir" -for parameter in $(ls -1); do - is_valid=$(grep "^$parameter\$" "$__cdist_tmp_file") - - [ "$is_valid" ] || __cdist_usage "Unknown parameter $parameter" -done - -################################################################################ -# Merge object -# -# Restore original destination -__cdist_out_object_dir="$__cdist_out_object_dir_orig" - -__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")" - -# -# If the object already exists and is exactly the same, merge it. Otherwise fail. -# -if [ -e "${__cdist_object_dir}" ]; then - # Allow diff to fail - set +e - diff -ru "${__cdist_new_object_dir}/${__cdist_name_parameter}" \ - "${__cdist_object_dir}/${__cdist_name_parameter}" \ - > "$__cdist_tmp_file"; ret=$? - set -e - - if [ "$ret" != 0 ]; then - # Go to standard error - exec >&2 - echo "${__cdist_object_self} already exists differently." - echo "Recorded source(s):" - __cdist_object_source "${__cdist_object_dir}" - echo "Differences:" - cat "$__cdist_tmp_file" - __cdist_exit_err "Aborting due to object conflict." - fi -else - # - # Move object into tree: - # Create full path minus .cdist and move .cdist - # - __cdist_new_object_base_dir="$(__cdist_object_base_dir "$__cdist_object_self")" - mkdir -p "$__cdist_new_object_base_dir" - mv "$__cdist_new_object_dir" "$__cdist_new_object_base_dir" -fi - -# Add "I was here message" -__cdist_object_source_add "${__cdist_object_dir}" From ce16725567b8733fa59a15d6e1745af8e1632c81 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 19 Sep 2011 00:37:39 +0200 Subject: [PATCH 15/22] todo for 2.0.1 Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 231489e9..84745512 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,3 +1,5 @@ +2.0.1: + - Rewrite cdist-type-emulator - Remove legacy code in cdist - Remove cdist-config @@ -9,6 +11,10 @@ Test: __cdist_type_base_dir=$(pwd -P)/conf/type __file +- Fix / rewrite cdist-quickstart + +-------------------------------------------------------------------------------- + - Initial install support - setup $__install = "yes" for manifest(s), gencode-* From de2a216ee668b8815ebb731bc0f544a3b988bf49 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 19 Sep 2011 00:39:43 +0200 Subject: [PATCH 16/22] cleanup bin/, move quickstart to mandir Signed-off-by: Nico Schottelius --- bin/cdist-config | 438 ------------------ .../man/man7/cdist-quickstart.text | 0 2 files changed, 438 deletions(-) delete mode 100644 bin/cdist-config rename bin/cdist-quickstart => doc/man/man7/cdist-quickstart.text (100%) diff --git a/bin/cdist-config b/bin/cdist-config deleted file mode 100644 index f7fb5ac0..00000000 --- a/bin/cdist-config +++ /dev/null @@ -1,438 +0,0 @@ -#!/bin/sh -# -# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# - -__cdist_version="1.7.0" - -# Fail if something bogus is going on -set -u - -################################################################################ -# cconf standard vars prefixed with cdist - -__cdist_pwd="$(pwd -P)" -__cdist_mydir="${0%/*}"; -__cdist_abs_mydir="$(cd "$__cdist_mydir" && pwd -P)" -__cdist_myname=${0##*/}; -__cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" - -################################################################################ -# Names / Constants -# -# Most values can be overriden from outside, so you can -# customise paths as you like (for distributors, geeks and hackers) -# - -: ${__cdist_name_bin:=bin} -: ${__cdist_name_cache:=cache} -: ${__cdist_name_code:=code} -: ${__cdist_name_conf_dir:=conf} -: ${__cdist_name_dot_cdist:=.cdist} -: ${__cdist_name_explorer:=explorer} -: ${__cdist_name_gencode:=gencode} -: ${__cdist_name_gencode_local:=local} -: ${__cdist_name_gencode_remote:=remote} -: ${__cdist_name_global:=global} -: ${__cdist_name_host:=host} -: ${__cdist_name_init:=init} -: ${__cdist_name_manifest:=manifest} -: ${__cdist_name_object:=object} -: ${__cdist_name_object_finished:=done} -: ${__cdist_name_object_prepared:=prepared} -: ${__cdist_name_object_id:=object_id} -: ${__cdist_name_object_source:=source} -: ${__cdist_name_objects_created:=.objects_created} -: ${__cdist_name_out_dir:=out} -: ${__cdist_name_parameter:=parameter} -: ${__cdist_name_parameter_required:=required} -: ${__cdist_name_parameter_optional:=optional} -: ${__cdist_name_require:=require} -: ${__cdist_name_self:=self} -: ${__cdist_name_singleton:=singleton} -: ${__cdist_name_target_host:=target_host} -: ${__cdist_name_target_user:=target_user} -: ${__cdist_name_type:=type} -: ${__cdist_name_type_bin:=type_bin} -: ${__cdist_name_type_explorer:=type_explorer} -: ${__cdist_name_type_explorer_pushed:=.explorer_pushed} - -# Used for IDs: Allow everything not starting with - and . -: ${__cdist_sane_regexp:=[^-\.].*} - -# Default remote user -: ${__cdist_remote_user:=root} - - -################################################################################ -# Exported variable names (usable for non core -# -: ${__cdist_name_var_explorer:=__$__cdist_name_explorer} -: ${__cdist_name_var_type_explorer:=__$__cdist_name_type_explorer} -: ${__cdist_name_var_global:=__$__cdist_name_global} -: ${__cdist_name_var_manifest:=__$__cdist_name_manifest} -: ${__cdist_name_var_target_host:=__$__cdist_name_target_host} -: ${__cdist_name_var_target_user:=__$__cdist_name_target_user} -: ${__cdist_name_var_object:=__$__cdist_name_object} -: ${__cdist_name_var_object_id:=__$__cdist_name_object_id} -: ${__cdist_name_var_self:=__$__cdist_name_self} -: ${__cdist_name_var_type:=__$__cdist_name_type} - - -################################################################################ -# Tempfiles -# -: ${__cdist_tmp_base_dir=/tmp} -__cdist_tmp_dir=$(mktemp -d "$__cdist_tmp_base_dir/cdist.XXXXXXXXXXXX") -__cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX") - -################################################################################ -# Local Base -# -: ${__cdist_local_base_dir:=$__cdist_tmp_dir} - -# Cache may *NOT* be below __cdist_local_base_dir! -: ${__cdist_local_base_cache_dir:=$__cdist_abs_mydir/../$__cdist_name_cache} - -: ${__cdist_conf_dir:="$(cd "$__cdist_abs_mydir/../conf" && pwd -P)"} - -: ${__cdist_explorer_dir:=$__cdist_conf_dir/$__cdist_name_explorer} -: ${__cdist_manifest_dir:=$__cdist_conf_dir/$__cdist_name_manifest} -: ${__cdist_manifest_init:=$__cdist_manifest_dir/$__cdist_name_init} -: ${__cdist_type_dir:=$__cdist_conf_dir/$__cdist_name_type} - -################################################################################ -# Local output -# -: ${__cdist_out_dir:=$__cdist_local_base_dir/$__cdist_name_out_dir} -: ${__cdist_out_explorer_dir:=$__cdist_out_dir/$__cdist_name_explorer} -: ${__cdist_out_object_dir:=$__cdist_out_dir/$__cdist_name_object} -: ${__cdist_out_type_dir:=$__cdist_out_dir/$__cdist_name_type} -: ${__cdist_out_type_bin_dir:=$__cdist_out_dir/$__cdist_name_type_bin} - -: ${__cdist_objects_created:=$__cdist_out_object_dir/$__cdist_name_objects_created} - -################################################################################ -# Remote base -# -: ${__cdist_remote_base_dir:=/var/lib/cdist} -: ${__cdist_remote_bin_dir:=$__cdist_remote_base_dir/$__cdist_name_bin} -: ${__cdist_remote_conf_dir:=$__cdist_remote_base_dir/$__cdist_name_conf_dir} - -: ${__cdist_remote_explorer_dir:=$__cdist_remote_conf_dir/$__cdist_name_explorer} -: ${__cdist_remote_type_dir:=$__cdist_remote_conf_dir/$__cdist_name_type} - -################################################################################ -# Remote output -# -: ${__cdist_remote_out_dir:=$__cdist_remote_base_dir/$__cdist_name_out_dir} -: ${__cdist_remote_out_explorer_dir:=$__cdist_remote_out_dir/$__cdist_name_explorer} -: ${__cdist_remote_out_object_dir:=$__cdist_remote_out_dir/$__cdist_name_object} - - -################################################################################ -# Internal functions -# -__cdist_echo() -{ - __cdist_echo_type="$1"; shift - - set +u - if [ "$__cdist_object_self" ]; then - __cdist_echo_prefix="${__cdist_object_self}:" - else - __cdist_echo_prefix="core: " - fi - set -u - - case "$__cdist_echo_type" in - debug) - set +u - if [ "$__cdist_debug" ]; then - echo $__cdist_echo_prefix "Debug: $@" - fi - set -u - ;; - info) - echo $__cdist_echo_prefix "$@" - ;; - warn) - echo $__cdist_echo_prefix "Warning: $@" - ;; - error) - echo $__cdist_echo_prefix "Error: $@" >&2 - ;; - *) - echo "CORE BUG, who created the broken commit in $0?" >&2 - exit 23 - ;; - esac -} - -__cdist_exec_fail_on_error() -{ - set +e - sh -e "$@" - if [ "$?" -ne 0 ]; then - __cdist_echo error "$1 exited non-zero" - __cdist_echo warn "Faulty code:" - cat "$1" - __cdist_exit_err "Aborting due to non-zero exit code." - fi -} - -__cdist_exit_err() -{ - __cdist_echo error "$@" - exit 1 -} - -__cdist_usage() -{ - __cdist_exit_err "$__cdist_myname: $@" -} - -__cdist_init_deploy() -{ - __cdist_echo info "Creating clean directory structure " - - # Ensure there is no old stuff, neither local nor remote - rm -rf "$__cdist_local_base_dir" - ssh "${__cdist_remote_user}@$1" "rm -rf ${__cdist_remote_base_dir}" - - # Init base - mkdir -p "$__cdist_local_base_dir" - ssh "${__cdist_remote_user}@$1" "mkdir -p ${__cdist_remote_base_dir}" - - # Link configuration source directory - consistent with remote - ln -sf "$__cdist_conf_dir" "$__cdist_local_base_dir/$__cdist_name_conf_dir" -} - -################################################################################ -# Cache -# -__cdist_cache_dir() -{ - cd "${__cdist_local_base_cache_dir}" && pwd -P -} - -__cdist_host_cache_dir() -{ - echo "$(__cdist_cache_dir)/$1" -} - -################################################################################ -# Object -# - -__cdist_object_code() -{ - echo "$(__cdist_object_dir "$1")/${__cdist_name_code}-$2" -} - -__cdist_object_prepared() -{ - echo "$(__cdist_object_dir "$1")/${__cdist_name_object_prepared}" -} - -__cdist_object_finished() -{ - echo "$(__cdist_object_dir "$1")/${__cdist_name_object_finished}" -} - -__cdist_object_dir() -{ - echo "$(__cdist_object_base_dir "$1")/${__cdist_name_dot_cdist}" -} - -__cdist_object_base_dir() -{ - echo "${__cdist_out_object_dir}/$1" -} - - -__cdist_object_id_from_object() -{ - echo "${1#*/}" -} - -# Find objects, remove ./ and /MARKER -__cdist_object_list() -{ - local basedir="$1"; shift - - # Use subshell to prevent changing cwd in program - ( - cd "${basedir}" - - find . -name "$__cdist_name_dot_cdist" | \ - sed -e 's;^./;;' -e "s;/${__cdist_name_dot_cdist}\$;;" - ) -} - -__cdist_object_parameter_dir() -{ - echo "$(__cdist_object_dir "$1")/${__cdist_name_parameter}" -} - -__cdist_object_require() -{ - echo "$(__cdist_object_dir "$1")/${__cdist_name_require}" -} - -__cdist_object_source_name() -{ - echo "$1/${__cdist_name_object_source}" -} - -__cdist_object_source() -{ - cat "$(__cdist_object_source_name "$1")" -} - -__cdist_object_source_add() -{ - echo "$__cdist_manifest" >> "$(__cdist_object_source_name "$1")" -} - -__cdist_object_type_explorer_dir() -{ - echo "$(__cdist_object_dir "$1")/${__cdist_name_explorer}" -} - -################################################################################ -# Remote -# - -__cdist_remote_object_base_dir() -{ - echo "${__cdist_remote_out_object_dir}/$1" -} - -__cdist_remote_object_dir() -{ - echo "$(__cdist_remote_object_base_dir "$1")/${__cdist_name_dot_cdist}" -} - -__cdist_remote_object_parameter_dir() -{ - echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_parameter}" -} - -__cdist_remote_object_type_explorer_dir() -{ - echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_explorer}" -} - - -__cdist_remote_type_explorer_dir() -{ - echo "${__cdist_remote_type_dir}/$1/${__cdist_name_explorer}" -} - - -################################################################################ -# Traps -# -__cdist_tmp_removal() -{ - rm -rf "${__cdist_tmp_dir}" -} - -# Does not work in children, will be called again in every script! -# Use only in interactive "front end" scripts -__cdist_kill_on_interrupt() -{ - __cdist_tmp_removal - kill 0 - exit 1 -} - -# Remove tempfiles at normal exit -trap __cdist_tmp_removal EXIT - - -################################################################################ -# Type -# -__cdist_type_dir() -{ - echo "${__cdist_type_dir}/$1" -} - -__cdist_type_explorer_dir() -{ - echo "${__cdist_type_dir}/$1/${__cdist_name_explorer}" -} - -__cdist_type_from_object() -{ - echo "${1%%/*}" -} - -__cdist_type_has_explorer() -{ - # We only create output, if there's at least one explorer - # and can thus be used as a boolean ;-) - if [ -d "$(__cdist_type_explorer_dir "$1")" ]; then - ls -1 "$(__cdist_type_explorer_dir "$1")" - fi -} - -__cdist_type_explorer_pushed() -{ - [ -f "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}" ] \ - && grep -q "$1" "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}" -} - -__cdist_type_explorer_pushed_add() -{ - [ -d "$__cdist_out_type_dir" ] || mkdir "$__cdist_out_type_dir" - echo "$1" >> "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}" -} - -__cdist_type_gencode() -{ - echo "${__cdist_type_dir}/$1/${__cdist_name_gencode}-$2" -} - -__cdist_type_manifest() -{ - echo "${__cdist_type_dir}/$1/${__cdist_name_manifest}" -} - -__cdist_type_parameter_dir() -{ - echo "$(__cdist_type_dir "$1")/${__cdist_name_parameter}" -} - -__cdist_type_parameter_optional() -{ - echo "$(__cdist_type_parameter_dir "$1")/$__cdist_name_parameter_optional" -} - -__cdist_type_parameter_required() -{ - echo "$(__cdist_type_parameter_dir "$1")/$__cdist_name_parameter_required" -} - -__cdist_type_singleton() -{ - echo "${__cdist_type_dir}/$1/${__cdist_name_singleton}" -} diff --git a/bin/cdist-quickstart b/doc/man/man7/cdist-quickstart.text similarity index 100% rename from bin/cdist-quickstart rename to doc/man/man7/cdist-quickstart.text From 9e99d420b688200df9abf742a2d36444b86c13d5 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 19 Sep 2011 00:52:09 +0200 Subject: [PATCH 17/22] in theory implement double definition strategy in new type emulator Signed-off-by: Nico Schottelius --- bin/cdist | 46 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/bin/cdist b/bin/cdist index 57c889f1..adb8bd78 100755 --- a/bin/cdist +++ b/bin/cdist @@ -613,6 +613,7 @@ def emulator(): type_dir = os.path.join(os.environ['__cdist_type_base_dir'], type) param_dir = os.path.join(type_dir, "parameter") global_dir = os.environ['__global'] + object_source = os.environ['__cdist_manifest'] parser = argparse.ArgumentParser(add_help=False) @@ -652,10 +653,20 @@ def emulator(): object_id, DOT_CDIST) param_out_dir = os.path.join(object_dir, "parameter") - try: - os.makedirs(param_out_dir, exist_ok=True) - except OSError as error: - exit_error(param_out_dir + ": " + error.args[1]) + object_source_file = os.path.join(object_dir, "source") + + if os.path.exists(param_out_dir): + object_exists = True + old_object_source_fd = open(object_source_file, "r") + old_object_source = old_object_source_fd.readlines() + old_object_source_fd.close() + + else: + object_exists = False + try: + os.makedirs(param_out_dir, exist_ok=True) + except OSError as error: + exit_error(param_out_dir + ": " + error.args[1]) # Record parameter params = vars(args) @@ -664,10 +675,26 @@ def emulator(): if value: file = os.path.join(param_out_dir, param) log.debug(file + "<-" + param + " = " + value) - param_fd = open(file, "w") - param_fd.writelines(value) - param_fd.close() + # Already exists, verify all parameter are the same + if object_exists: + if not os.path.isfile(file): + print("New parameter + " + param + "specified, aborting") + print("Source = " + old_object_source + "new =" + object_source) + sys.exit(1) + else: + param_fd = open(file, "r") + param_old = param_fd.realines() + param_fd.close() + + if(param_old != param): + print("Parameter differs: " + param_old + "vs," + param) + print("Source = " + old_object_source + "new =" + object_source) + sys.exit(1) + else: + param_fd = open(file, "w") + param_fd.writelines(value) + param_fd.close() # Record requirements if "__require" in os.environ: @@ -677,12 +704,9 @@ def emulator(): require_fd.writelines(requirements.split(" ")) require_fd.close() - # FIXME: Merge / mv object into tree - # Record / Append source - source = os.environ['__cdist_manifest'] source_fd = open(os.path.join(object_dir, "source"), "a") - source_fd.writelines(source) + source_fd.writelines(object_source) source_fd.close() # sys.exit(1) From f8c49708cf7cb24dc3e1afbce8ff103999b5ef71 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 19 Sep 2011 00:53:06 +0200 Subject: [PATCH 18/22] contrib is not contrib but other stuff this also help tab expansion Signed-off-by: Nico Schottelius --- .../examples/nico/conf/type/__nico_afs/files/afs/CellServDB | 0 .../examples/nico/conf/type/__nico_afs/files/afs/ThisCell | 0 .../examples/nico/conf/type/__nico_afs/files/krb5/krb5.conf | 0 .../examples/nico/conf/type/__nico_afs/files/ssh/JAS.pub | 0 .../examples/nico/conf/type/__nico_afs/files/ssh/bugblue.pub | 0 .../examples/nico/conf/type/__nico_afs/files/ssh/docsteel.pub | 0 .../examples/nico/conf/type/__nico_afs/files/ssh/downhill.pub | 0 .../examples/nico/conf/type/__nico_afs/files/ssh/sur5r@samsa.pub | 0 {contrib => other}/examples/nico/conf/type/__nico_afs/manifest | 0 {contrib => other}/examples/nico/conf/type/__nico_afs/singleton | 0 .../examples/nico/conf/type/__nico_desktop/files/hostname | 0 .../examples/nico/conf/type/__nico_desktop/files/slim-preseed | 0 .../examples/nico/conf/type/__nico_desktop/manifest | 0 .../examples/nico/conf/type/__nico_desktop/parameter/required | 0 .../examples/nico/conf/type/__nico_desktop/singleton | 0 .../examples/nico/conf/type/__nico_mpd/files/slim-preseed | 0 {contrib => other}/examples/nico/conf/type/__nico_mpd/manifest | 0 .../examples/nico/conf/type/__nico_mpd/parameter/required | 0 {contrib => other}/examples/nico/conf/type/__nico_mpd/singleton | 0 .../examples/nico/conf/type/__nico_network/files/interfaces-eth0 | 0 .../examples/nico/conf/type/__nico_network/files/interfaces-wlan0 | 0 .../examples/nico/conf/type/__nico_network/manifest | 0 .../examples/nico/conf/type/__nico_network/parameter/required | 0 .../examples/nico/conf/type/__nico_network/singleton | 0 .../examples/nico/conf/type/__nico_nfs_client/files/slim-preseed | 0 .../examples/nico/conf/type/__nico_nfs_client/manifest | 0 .../examples/nico/conf/type/__nico_nfs_client/singleton | 0 .../examples/nico/conf/type/__nico_notebook/manifest | 0 .../examples/nico/conf/type/__nico_notebook/singleton | 0 .../examples/nico/conf/type/__nico_packages/manifest | 0 .../examples/nico/conf/type/__nico_packages/singleton | 0 .../examples/nico/conf/type/__nico_sudo/files/sudo-nico | 0 {contrib => other}/examples/nico/conf/type/__nico_sudo/manifest | 0 .../examples/nico/conf/type/__nico_sudo/parameter/gencode | 0 .../examples/nico/conf/type/__nico_sudo/parameter/manifest | 0 .../examples/nico/conf/type/__nico_sudo/parameter/optional | 0 .../examples/nico/conf/type/__nico_sudo/parameter/required | 0 {contrib => other}/examples/nico/conf/type/__nico_sudo/singleton | 0 .../examples/nico/conf/type/__nico_tee/files/99-apt-nico | 0 .../examples/nico/conf/type/__nico_tee/files/hostname | 0 {contrib => other}/examples/nico/conf/type/__nico_tee/manifest | 0 {contrib => other}/examples/nico/conf/type/__nico_tee/singleton | 0 .../types_pending_inclusion/__package_zypper/README | 0 .../types_pending_inclusion/__package_zypper/explorer/pkg_version | 0 .../types_pending_inclusion/__package_zypper/gencode-remote | 0 .../types_pending_inclusion/__package_zypper/man.text | 0 .../types_pending_inclusion/__package_zypper/parameter/optional | 0 .../types_pending_inclusion/__package_zypper/parameter/required | 0 48 files changed, 0 insertions(+), 0 deletions(-) rename {contrib => other}/examples/nico/conf/type/__nico_afs/files/afs/CellServDB (100%) rename {contrib => other}/examples/nico/conf/type/__nico_afs/files/afs/ThisCell (100%) rename {contrib => other}/examples/nico/conf/type/__nico_afs/files/krb5/krb5.conf (100%) rename {contrib => other}/examples/nico/conf/type/__nico_afs/files/ssh/JAS.pub (100%) rename {contrib => other}/examples/nico/conf/type/__nico_afs/files/ssh/bugblue.pub (100%) rename {contrib => other}/examples/nico/conf/type/__nico_afs/files/ssh/docsteel.pub (100%) rename {contrib => other}/examples/nico/conf/type/__nico_afs/files/ssh/downhill.pub (100%) rename {contrib => other}/examples/nico/conf/type/__nico_afs/files/ssh/sur5r@samsa.pub (100%) rename {contrib => other}/examples/nico/conf/type/__nico_afs/manifest (100%) rename {contrib => other}/examples/nico/conf/type/__nico_afs/singleton (100%) rename {contrib => other}/examples/nico/conf/type/__nico_desktop/files/hostname (100%) rename {contrib => other}/examples/nico/conf/type/__nico_desktop/files/slim-preseed (100%) rename {contrib => other}/examples/nico/conf/type/__nico_desktop/manifest (100%) rename {contrib => other}/examples/nico/conf/type/__nico_desktop/parameter/required (100%) rename {contrib => other}/examples/nico/conf/type/__nico_desktop/singleton (100%) rename {contrib => other}/examples/nico/conf/type/__nico_mpd/files/slim-preseed (100%) rename {contrib => other}/examples/nico/conf/type/__nico_mpd/manifest (100%) rename {contrib => other}/examples/nico/conf/type/__nico_mpd/parameter/required (100%) rename {contrib => other}/examples/nico/conf/type/__nico_mpd/singleton (100%) rename {contrib => other}/examples/nico/conf/type/__nico_network/files/interfaces-eth0 (100%) rename {contrib => other}/examples/nico/conf/type/__nico_network/files/interfaces-wlan0 (100%) rename {contrib => other}/examples/nico/conf/type/__nico_network/manifest (100%) rename {contrib => other}/examples/nico/conf/type/__nico_network/parameter/required (100%) rename {contrib => other}/examples/nico/conf/type/__nico_network/singleton (100%) rename {contrib => other}/examples/nico/conf/type/__nico_nfs_client/files/slim-preseed (100%) rename {contrib => other}/examples/nico/conf/type/__nico_nfs_client/manifest (100%) rename {contrib => other}/examples/nico/conf/type/__nico_nfs_client/singleton (100%) rename {contrib => other}/examples/nico/conf/type/__nico_notebook/manifest (100%) rename {contrib => other}/examples/nico/conf/type/__nico_notebook/singleton (100%) rename {contrib => other}/examples/nico/conf/type/__nico_packages/manifest (100%) rename {contrib => other}/examples/nico/conf/type/__nico_packages/singleton (100%) rename {contrib => other}/examples/nico/conf/type/__nico_sudo/files/sudo-nico (100%) rename {contrib => other}/examples/nico/conf/type/__nico_sudo/manifest (100%) rename {contrib => other}/examples/nico/conf/type/__nico_sudo/parameter/gencode (100%) rename {contrib => other}/examples/nico/conf/type/__nico_sudo/parameter/manifest (100%) rename {contrib => other}/examples/nico/conf/type/__nico_sudo/parameter/optional (100%) rename {contrib => other}/examples/nico/conf/type/__nico_sudo/parameter/required (100%) rename {contrib => other}/examples/nico/conf/type/__nico_sudo/singleton (100%) rename {contrib => other}/examples/nico/conf/type/__nico_tee/files/99-apt-nico (100%) rename {contrib => other}/examples/nico/conf/type/__nico_tee/files/hostname (100%) rename {contrib => other}/examples/nico/conf/type/__nico_tee/manifest (100%) rename {contrib => other}/examples/nico/conf/type/__nico_tee/singleton (100%) rename {contrib => other}/types_pending_inclusion/__package_zypper/README (100%) rename {contrib => other}/types_pending_inclusion/__package_zypper/explorer/pkg_version (100%) rename {contrib => other}/types_pending_inclusion/__package_zypper/gencode-remote (100%) rename {contrib => other}/types_pending_inclusion/__package_zypper/man.text (100%) rename {contrib => other}/types_pending_inclusion/__package_zypper/parameter/optional (100%) rename {contrib => other}/types_pending_inclusion/__package_zypper/parameter/required (100%) diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/afs/CellServDB b/other/examples/nico/conf/type/__nico_afs/files/afs/CellServDB similarity index 100% rename from contrib/examples/nico/conf/type/__nico_afs/files/afs/CellServDB rename to other/examples/nico/conf/type/__nico_afs/files/afs/CellServDB diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/afs/ThisCell b/other/examples/nico/conf/type/__nico_afs/files/afs/ThisCell similarity index 100% rename from contrib/examples/nico/conf/type/__nico_afs/files/afs/ThisCell rename to other/examples/nico/conf/type/__nico_afs/files/afs/ThisCell diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/krb5/krb5.conf b/other/examples/nico/conf/type/__nico_afs/files/krb5/krb5.conf similarity index 100% rename from contrib/examples/nico/conf/type/__nico_afs/files/krb5/krb5.conf rename to other/examples/nico/conf/type/__nico_afs/files/krb5/krb5.conf diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/ssh/JAS.pub b/other/examples/nico/conf/type/__nico_afs/files/ssh/JAS.pub similarity index 100% rename from contrib/examples/nico/conf/type/__nico_afs/files/ssh/JAS.pub rename to other/examples/nico/conf/type/__nico_afs/files/ssh/JAS.pub diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/ssh/bugblue.pub b/other/examples/nico/conf/type/__nico_afs/files/ssh/bugblue.pub similarity index 100% rename from contrib/examples/nico/conf/type/__nico_afs/files/ssh/bugblue.pub rename to other/examples/nico/conf/type/__nico_afs/files/ssh/bugblue.pub diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/ssh/docsteel.pub b/other/examples/nico/conf/type/__nico_afs/files/ssh/docsteel.pub similarity index 100% rename from contrib/examples/nico/conf/type/__nico_afs/files/ssh/docsteel.pub rename to other/examples/nico/conf/type/__nico_afs/files/ssh/docsteel.pub diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/ssh/downhill.pub b/other/examples/nico/conf/type/__nico_afs/files/ssh/downhill.pub similarity index 100% rename from contrib/examples/nico/conf/type/__nico_afs/files/ssh/downhill.pub rename to other/examples/nico/conf/type/__nico_afs/files/ssh/downhill.pub diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/ssh/sur5r@samsa.pub b/other/examples/nico/conf/type/__nico_afs/files/ssh/sur5r@samsa.pub similarity index 100% rename from contrib/examples/nico/conf/type/__nico_afs/files/ssh/sur5r@samsa.pub rename to other/examples/nico/conf/type/__nico_afs/files/ssh/sur5r@samsa.pub diff --git a/contrib/examples/nico/conf/type/__nico_afs/manifest b/other/examples/nico/conf/type/__nico_afs/manifest similarity index 100% rename from contrib/examples/nico/conf/type/__nico_afs/manifest rename to other/examples/nico/conf/type/__nico_afs/manifest diff --git a/contrib/examples/nico/conf/type/__nico_afs/singleton b/other/examples/nico/conf/type/__nico_afs/singleton similarity index 100% rename from contrib/examples/nico/conf/type/__nico_afs/singleton rename to other/examples/nico/conf/type/__nico_afs/singleton diff --git a/contrib/examples/nico/conf/type/__nico_desktop/files/hostname b/other/examples/nico/conf/type/__nico_desktop/files/hostname similarity index 100% rename from contrib/examples/nico/conf/type/__nico_desktop/files/hostname rename to other/examples/nico/conf/type/__nico_desktop/files/hostname diff --git a/contrib/examples/nico/conf/type/__nico_desktop/files/slim-preseed b/other/examples/nico/conf/type/__nico_desktop/files/slim-preseed similarity index 100% rename from contrib/examples/nico/conf/type/__nico_desktop/files/slim-preseed rename to other/examples/nico/conf/type/__nico_desktop/files/slim-preseed diff --git a/contrib/examples/nico/conf/type/__nico_desktop/manifest b/other/examples/nico/conf/type/__nico_desktop/manifest similarity index 100% rename from contrib/examples/nico/conf/type/__nico_desktop/manifest rename to other/examples/nico/conf/type/__nico_desktop/manifest diff --git a/contrib/examples/nico/conf/type/__nico_desktop/parameter/required b/other/examples/nico/conf/type/__nico_desktop/parameter/required similarity index 100% rename from contrib/examples/nico/conf/type/__nico_desktop/parameter/required rename to other/examples/nico/conf/type/__nico_desktop/parameter/required diff --git a/contrib/examples/nico/conf/type/__nico_desktop/singleton b/other/examples/nico/conf/type/__nico_desktop/singleton similarity index 100% rename from contrib/examples/nico/conf/type/__nico_desktop/singleton rename to other/examples/nico/conf/type/__nico_desktop/singleton diff --git a/contrib/examples/nico/conf/type/__nico_mpd/files/slim-preseed b/other/examples/nico/conf/type/__nico_mpd/files/slim-preseed similarity index 100% rename from contrib/examples/nico/conf/type/__nico_mpd/files/slim-preseed rename to other/examples/nico/conf/type/__nico_mpd/files/slim-preseed diff --git a/contrib/examples/nico/conf/type/__nico_mpd/manifest b/other/examples/nico/conf/type/__nico_mpd/manifest similarity index 100% rename from contrib/examples/nico/conf/type/__nico_mpd/manifest rename to other/examples/nico/conf/type/__nico_mpd/manifest diff --git a/contrib/examples/nico/conf/type/__nico_mpd/parameter/required b/other/examples/nico/conf/type/__nico_mpd/parameter/required similarity index 100% rename from contrib/examples/nico/conf/type/__nico_mpd/parameter/required rename to other/examples/nico/conf/type/__nico_mpd/parameter/required diff --git a/contrib/examples/nico/conf/type/__nico_mpd/singleton b/other/examples/nico/conf/type/__nico_mpd/singleton similarity index 100% rename from contrib/examples/nico/conf/type/__nico_mpd/singleton rename to other/examples/nico/conf/type/__nico_mpd/singleton diff --git a/contrib/examples/nico/conf/type/__nico_network/files/interfaces-eth0 b/other/examples/nico/conf/type/__nico_network/files/interfaces-eth0 similarity index 100% rename from contrib/examples/nico/conf/type/__nico_network/files/interfaces-eth0 rename to other/examples/nico/conf/type/__nico_network/files/interfaces-eth0 diff --git a/contrib/examples/nico/conf/type/__nico_network/files/interfaces-wlan0 b/other/examples/nico/conf/type/__nico_network/files/interfaces-wlan0 similarity index 100% rename from contrib/examples/nico/conf/type/__nico_network/files/interfaces-wlan0 rename to other/examples/nico/conf/type/__nico_network/files/interfaces-wlan0 diff --git a/contrib/examples/nico/conf/type/__nico_network/manifest b/other/examples/nico/conf/type/__nico_network/manifest similarity index 100% rename from contrib/examples/nico/conf/type/__nico_network/manifest rename to other/examples/nico/conf/type/__nico_network/manifest diff --git a/contrib/examples/nico/conf/type/__nico_network/parameter/required b/other/examples/nico/conf/type/__nico_network/parameter/required similarity index 100% rename from contrib/examples/nico/conf/type/__nico_network/parameter/required rename to other/examples/nico/conf/type/__nico_network/parameter/required diff --git a/contrib/examples/nico/conf/type/__nico_network/singleton b/other/examples/nico/conf/type/__nico_network/singleton similarity index 100% rename from contrib/examples/nico/conf/type/__nico_network/singleton rename to other/examples/nico/conf/type/__nico_network/singleton diff --git a/contrib/examples/nico/conf/type/__nico_nfs_client/files/slim-preseed b/other/examples/nico/conf/type/__nico_nfs_client/files/slim-preseed similarity index 100% rename from contrib/examples/nico/conf/type/__nico_nfs_client/files/slim-preseed rename to other/examples/nico/conf/type/__nico_nfs_client/files/slim-preseed diff --git a/contrib/examples/nico/conf/type/__nico_nfs_client/manifest b/other/examples/nico/conf/type/__nico_nfs_client/manifest similarity index 100% rename from contrib/examples/nico/conf/type/__nico_nfs_client/manifest rename to other/examples/nico/conf/type/__nico_nfs_client/manifest diff --git a/contrib/examples/nico/conf/type/__nico_nfs_client/singleton b/other/examples/nico/conf/type/__nico_nfs_client/singleton similarity index 100% rename from contrib/examples/nico/conf/type/__nico_nfs_client/singleton rename to other/examples/nico/conf/type/__nico_nfs_client/singleton diff --git a/contrib/examples/nico/conf/type/__nico_notebook/manifest b/other/examples/nico/conf/type/__nico_notebook/manifest similarity index 100% rename from contrib/examples/nico/conf/type/__nico_notebook/manifest rename to other/examples/nico/conf/type/__nico_notebook/manifest diff --git a/contrib/examples/nico/conf/type/__nico_notebook/singleton b/other/examples/nico/conf/type/__nico_notebook/singleton similarity index 100% rename from contrib/examples/nico/conf/type/__nico_notebook/singleton rename to other/examples/nico/conf/type/__nico_notebook/singleton diff --git a/contrib/examples/nico/conf/type/__nico_packages/manifest b/other/examples/nico/conf/type/__nico_packages/manifest similarity index 100% rename from contrib/examples/nico/conf/type/__nico_packages/manifest rename to other/examples/nico/conf/type/__nico_packages/manifest diff --git a/contrib/examples/nico/conf/type/__nico_packages/singleton b/other/examples/nico/conf/type/__nico_packages/singleton similarity index 100% rename from contrib/examples/nico/conf/type/__nico_packages/singleton rename to other/examples/nico/conf/type/__nico_packages/singleton diff --git a/contrib/examples/nico/conf/type/__nico_sudo/files/sudo-nico b/other/examples/nico/conf/type/__nico_sudo/files/sudo-nico similarity index 100% rename from contrib/examples/nico/conf/type/__nico_sudo/files/sudo-nico rename to other/examples/nico/conf/type/__nico_sudo/files/sudo-nico diff --git a/contrib/examples/nico/conf/type/__nico_sudo/manifest b/other/examples/nico/conf/type/__nico_sudo/manifest similarity index 100% rename from contrib/examples/nico/conf/type/__nico_sudo/manifest rename to other/examples/nico/conf/type/__nico_sudo/manifest diff --git a/contrib/examples/nico/conf/type/__nico_sudo/parameter/gencode b/other/examples/nico/conf/type/__nico_sudo/parameter/gencode similarity index 100% rename from contrib/examples/nico/conf/type/__nico_sudo/parameter/gencode rename to other/examples/nico/conf/type/__nico_sudo/parameter/gencode diff --git a/contrib/examples/nico/conf/type/__nico_sudo/parameter/manifest b/other/examples/nico/conf/type/__nico_sudo/parameter/manifest similarity index 100% rename from contrib/examples/nico/conf/type/__nico_sudo/parameter/manifest rename to other/examples/nico/conf/type/__nico_sudo/parameter/manifest diff --git a/contrib/examples/nico/conf/type/__nico_sudo/parameter/optional b/other/examples/nico/conf/type/__nico_sudo/parameter/optional similarity index 100% rename from contrib/examples/nico/conf/type/__nico_sudo/parameter/optional rename to other/examples/nico/conf/type/__nico_sudo/parameter/optional diff --git a/contrib/examples/nico/conf/type/__nico_sudo/parameter/required b/other/examples/nico/conf/type/__nico_sudo/parameter/required similarity index 100% rename from contrib/examples/nico/conf/type/__nico_sudo/parameter/required rename to other/examples/nico/conf/type/__nico_sudo/parameter/required diff --git a/contrib/examples/nico/conf/type/__nico_sudo/singleton b/other/examples/nico/conf/type/__nico_sudo/singleton similarity index 100% rename from contrib/examples/nico/conf/type/__nico_sudo/singleton rename to other/examples/nico/conf/type/__nico_sudo/singleton diff --git a/contrib/examples/nico/conf/type/__nico_tee/files/99-apt-nico b/other/examples/nico/conf/type/__nico_tee/files/99-apt-nico similarity index 100% rename from contrib/examples/nico/conf/type/__nico_tee/files/99-apt-nico rename to other/examples/nico/conf/type/__nico_tee/files/99-apt-nico diff --git a/contrib/examples/nico/conf/type/__nico_tee/files/hostname b/other/examples/nico/conf/type/__nico_tee/files/hostname similarity index 100% rename from contrib/examples/nico/conf/type/__nico_tee/files/hostname rename to other/examples/nico/conf/type/__nico_tee/files/hostname diff --git a/contrib/examples/nico/conf/type/__nico_tee/manifest b/other/examples/nico/conf/type/__nico_tee/manifest similarity index 100% rename from contrib/examples/nico/conf/type/__nico_tee/manifest rename to other/examples/nico/conf/type/__nico_tee/manifest diff --git a/contrib/examples/nico/conf/type/__nico_tee/singleton b/other/examples/nico/conf/type/__nico_tee/singleton similarity index 100% rename from contrib/examples/nico/conf/type/__nico_tee/singleton rename to other/examples/nico/conf/type/__nico_tee/singleton diff --git a/contrib/types_pending_inclusion/__package_zypper/README b/other/types_pending_inclusion/__package_zypper/README similarity index 100% rename from contrib/types_pending_inclusion/__package_zypper/README rename to other/types_pending_inclusion/__package_zypper/README diff --git a/contrib/types_pending_inclusion/__package_zypper/explorer/pkg_version b/other/types_pending_inclusion/__package_zypper/explorer/pkg_version similarity index 100% rename from contrib/types_pending_inclusion/__package_zypper/explorer/pkg_version rename to other/types_pending_inclusion/__package_zypper/explorer/pkg_version diff --git a/contrib/types_pending_inclusion/__package_zypper/gencode-remote b/other/types_pending_inclusion/__package_zypper/gencode-remote similarity index 100% rename from contrib/types_pending_inclusion/__package_zypper/gencode-remote rename to other/types_pending_inclusion/__package_zypper/gencode-remote diff --git a/contrib/types_pending_inclusion/__package_zypper/man.text b/other/types_pending_inclusion/__package_zypper/man.text similarity index 100% rename from contrib/types_pending_inclusion/__package_zypper/man.text rename to other/types_pending_inclusion/__package_zypper/man.text diff --git a/contrib/types_pending_inclusion/__package_zypper/parameter/optional b/other/types_pending_inclusion/__package_zypper/parameter/optional similarity index 100% rename from contrib/types_pending_inclusion/__package_zypper/parameter/optional rename to other/types_pending_inclusion/__package_zypper/parameter/optional diff --git a/contrib/types_pending_inclusion/__package_zypper/parameter/required b/other/types_pending_inclusion/__package_zypper/parameter/required similarity index 100% rename from contrib/types_pending_inclusion/__package_zypper/parameter/required rename to other/types_pending_inclusion/__package_zypper/parameter/required From 1745f0bbc36a8f6da4c11afda63c6a3747e092ae Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 19 Sep 2011 08:31:14 +0200 Subject: [PATCH 19/22] also document TMPDIR and TEMP Signed-off-by: Nico Schottelius --- doc/man/man1/cdist.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/man/man1/cdist.text b/doc/man/man1/cdist.text index c43e4e1c..03948036 100644 --- a/doc/man/man1/cdist.text +++ b/doc/man/man1/cdist.text @@ -84,7 +84,7 @@ cdist --version ENVIRONMENT ----------- -TMP:: +TMPDIR, TEMP, TMP:: Setup the base directory for the temporary directory. See http://docs.python.org/py3k/library/tempfile.html for more information. This is rather useful, if the standard From 2a5ee06b0e68537d8489300b652715430e58df9d Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 19 Sep 2011 14:04:52 +0200 Subject: [PATCH 20/22] no need to redefine again and again inside loop Signed-off-by: Steven Armstrong --- bin/cdist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist b/bin/cdist index adb8bd78..6726295a 100755 --- a/bin/cdist +++ b/bin/cdist @@ -354,8 +354,8 @@ class Cdist: def link_type_to_emulator(self): """Link type names to cdist-type-emulator""" + source = sys.argv[0] for type in self.list_types(): - source = sys.argv[0] destination = os.path.join(self.bin_dir, type) log.debug("Linking %s to %s", source, destination) os.symlink(source, destination) From 1c1ebac90c22ade5a35310b92955230665984fdd Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 19 Sep 2011 14:05:31 +0200 Subject: [PATCH 21/22] dont break if sys.argv[0] is a relative path Signed-off-by: Steven Armstrong --- bin/cdist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist b/bin/cdist index 6726295a..a5383524 100755 --- a/bin/cdist +++ b/bin/cdist @@ -354,7 +354,7 @@ class Cdist: def link_type_to_emulator(self): """Link type names to cdist-type-emulator""" - source = sys.argv[0] + source = os.path.abspath(sys.argv[0]) for type in self.list_types(): destination = os.path.join(self.bin_dir, type) log.debug("Linking %s to %s", source, destination) From de7123df792a0bba7ad0b92460c0a06a40578775 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 19 Sep 2011 14:38:52 +0200 Subject: [PATCH 22/22] always catch KeyboardInterrupt Signed-off-by: Nico Schottelius --- bin/cdist | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/cdist b/bin/cdist index a5383524..5ce947ef 100755 --- a/bin/cdist +++ b/bin/cdist @@ -772,13 +772,13 @@ def commandline(): logging.root.setLevel(logging.DEBUG) log.debug(args) - try: - args.func(args) - except KeyboardInterrupt: - sys.exit(0) + args.func(args) if __name__ == "__main__": - if re.match(TYPE_PREFIX, os.path.basename(sys.argv[0])): - emulator() - else: - commandline() + try: + if re.match(TYPE_PREFIX, os.path.basename(sys.argv[0])): + emulator() + else: + commandline() + except KeyboardInterrupt: + sys.exit(0)