NTTLimitedRD / plumbery

Cloud automation at Dimension Data with Apache Libcloud
Apache License 2.0
14 stars 9 forks source link

plumbery ping breaking on 0.9.5 #32

Closed asimkhawaja closed 8 years ago

asimkhawaja commented 8 years ago

Hey Team, I was in the midst of testing plumbery 0.9.5 when I observed that ping is breaking, whilst it was working before in 0.8.0. Can we confirm if this is a bug or is the command deprecated.

Running fittings on plumbery 0.8.0 works great:

[root@89034df40792 ~]# python -m plumbery -v
python -m plumbery 0.8.0
[root@89034df40792 ~]# python -m plumbery -d fittings.yaml ping
Default values:
- cloud-config: {'ssh_pwauth': True, 'disable_root': False}
Adding facility
- regionId: dd-au
- locationId: AU10
Loading secrets from '2cd9a0008bdc2f792125f9953e98f077.secrets'
Importing 'polishers.ping'
Instantiating 'PingPolisher'
Using polisher 'ping'
Polishing all blueprints
Getting driver for 'dd-au / None'
Getting location 'AU10'
Plumbing at 'AU10' Australia - Melbourne MCP2 (Australia)
- available blueprints: 'mysql'
Polishing blueprint 'mysql'
Listing network domains
- found 2 network domains
Listing Ethernet networks
- found 2 Ethernet networks
Pinging node 'mysqltest_Ubuntu14'
- node is up and running
- private: 10.0.0.8
- ipv6: 2402:9900:211:1116:5025:5d09:b161:6465
Pinging node 'mysqltest_CENTOS7'
- node is up and running
- private: 10.0.0.9
- ipv6: 2402:9900:211:1116:30e8:12f0:58d3:2c2d
Pinging node 'mysqltest_RH7'
- not found
Worked for you for 2 seconds locally, and for 6 seconds in the cloud
[root@89034df40792 ~]#

Doesnt work so good on plumbery 0.9.5

[root@016092f83518 ~]# python -m plumbery -v
python -m plumbery 0.9.5
[root@016092f83518 ~]# python -m plumbery -d fittings.yaml ping
03:42:34 __main__ parse_args - loading 'fittings.yaml'
03:42:34 engine set_settings Default values:
03:42:34 engine set_settings - cloud-config: {'ssh_pwauth': True, 'disable_root': False}
03:42:34 engine add_facility Adding facility <PlumberyFacility settings: {'regionId': 'dd-au', 'locati
03:42:34 engine add_facility - regionId: dd-au
03:42:34 engine add_facility - locationId: AU10
03:42:34 engine load_secrets Loading secrets from '53896d511ba8b94e3f8ba7436e3e04a4.secrets'
03:42:34 polisher from_shelf Importing 'polishers.ping'
03:42:34 polisher from_shelf Instantiating 'PingPolisher'
03:42:34 polisher filter Using polisher 'ping'
03:42:34 engine polish_all_blueprints Polishing all blueprints
03:42:34 facility power_on Getting driver for 'dd-au / None'
03:42:34 facility power_on Getting location 'AU10'
03:42:35 facility focus  Plumbing at 'AU10' Australia - Melbourne MCP2 (Australia)
03:42:35 facility focus  - available blueprints: 'mysql'
03:42:35 facility polish_all_blueprints Polishing blueprint 'mysql'
03:42:35 infrastructure get_network_domain Listing network domains
03:42:35 infrastructure get_network_domain - found 2 network domains
03:42:35 infrastructure get_ethernet Listing Ethernet networks
03:42:36 infrastructure get_ethernet - found 2 Ethernet networks
03:42:36 __main__ main   Unable to do 'ping'
Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/site-packages/plumbery/__main__.py", line 273, in <module>
    main()
  File "/usr/lib/python2.7/site-packages/plumbery/__main__.py", line 255, in main
    engine.do(args.action, args.blueprints, args.facilities)
  File "/usr/lib/python2.7/site-packages/plumbery/engine.py", line 1024, in do
    facilities=facilities)
  File "/usr/lib/python2.7/site-packages/plumbery/engine.py", line 1215, in polish_all_blueprints
    facility.polish_all_blueprints(polishers)
  File "/usr/lib/python2.7/site-packages/plumbery/facility.py", line 830, in polish_all_blueprints
    self.polish_blueprint(name, polishers)
  File "/usr/lib/python2.7/site-packages/plumbery/facility.py", line 864, in polish_blueprint
    nodes.polish_blueprint(blueprint, polishers, container)
  File "/usr/lib/python2.7/site-packages/plumbery/nodes.py", line 744, in polish_blueprint
    for label in self.expand_labels(label):
  File "/usr/lib/python2.7/site-packages/plumbery/nodes.py", line 492, in expand_labels
    logging.warning("Warning: '{}' is not a valid hostname"
NameError: global name 'logging' is not defined
[root@016092f83518 ~]#

The fittings file being used in both cases:


information:
    - "Setup mysql servers for testing on Ubuntu /Redhat /CentOS for BaaS "
defaults:
  cloud-config:
    disable_root: false
    #uses shared secret password from env
    ssh_pwauth: true

---
# Production Australia
locationId: AU10
regionId: dd-au
blueprints:
  - mysql:
      domain:
        name: BaaS_Test_AU10
        service: advanced
      ethernet:
        name: "baas_vlan"
        subnet: 10.0.0.0
      nodes:
        - mysqltest_Ubuntu14:
           information : "mysql base node for Ubuntu14 "
           appliance : 'Ubuntu 14'
           cloud-config:
             hostname: "mysqltest_ubuntu14"
             package_upgrade: true
             packages:
               - git
               - ntp
               - mysql-server
             final_message: "Should be done in $UPTIME seconds"
             write_files:
                # a script in awk to update the /etc/hosts file
                #
                - path: /root/master_db.sql
                  content: |
                    DROP DATABASE IF EXISTS TestBaaS;
                    CREATE DATABASE TestBaaS;
                    use TestBaaS;
                    CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20), species VARCHAR(20), sex CHAR(1), birth DATE, death DATE);
                    DESCRIBE pet;
                    INSERT INTO pet VALUES ('Puffball','Diane','hamster','f','1999-03-30',NULL);INSERT INTO pet VALUES ('Tata','Tom','snake','f','2013-08-20',NULL);
                    SELECT * FROM pet;

             runcmd:
               - echo "============Finishing Cloud config ===="
               - mysql < /root/master_db.sql
        - mysqltest_CENTOS7:
           information : "mysql base node for CentOS 7 "
           appliance : 'CentOS 7'
           cloud-config:
             hostname: "mysqltest_centos7"
             package_upgrade: true
             packages:
               - git
               - ntp
               - mariadb-server
               - mariadb
               - mysql-server
             final_message: "Should be done in $UPTIME seconds"
             write_files:
                # a script in awk to update the /etc/hosts file
                #
                - path: /root/master_db.sql
                  content: |
                    DROP DATABASE IF EXISTS TestBaaS;
                    CREATE DATABASE TestBaaS;
                    use TestBaaS;
                    CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20), species VARCHAR(20), sex CHAR(1), birth DATE, death DATE);
                    DESCRIBE pet;
                    INSERT INTO pet VALUES ('Puffball','Diane','hamster','f','1999-03-30',NULL);INSERT INTO pet VALUES ('Tata','Tom','snake','f','2013-08-20',NULL);
                    SELECT * FROM pet;

             runcmd:
               - echo "============Finishing Cloud config ===="
               - ls -l
               - service mariadb start
               - mysql < /root/master_db.sql

        - mysqltest_RH7:
           information : "mysql base node for RH7  "
           appliance : 'RedHat 7'
           cloud-config:
             hostname: "mysqltest_rh7"
             package_upgrade: true
             packages:
               - git
               - ntp
               - mariadb-server
               - mariadb
             final_message: "Should be done in $UPTIME seconds"
             write_files:
                # a script in awk to update the /etc/hosts file
                #
                - path: /root/master_db.sql
                  content: |
                    DROP DATABASE IF EXISTS TestBaaS;
                    CREATE DATABASE TestBaaS;
                    use TestBaaS;
                    CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20), species VARCHAR(20), sex CHAR(1), birth DATE, death DATE);
                    DESCRIBE pet;
                    INSERT INTO pet VALUES ('Puffball','Diane','hamster','f','1999-03-30',NULL);INSERT INTO pet VALUES ('Tata','Tom','snake','f','2013-08-20',NULL);
                    SELECT * FROM pet;

             runcmd:
               - echo "============Finishing Cloud config ===="
               - ls -l
               - service mariadb start
               - mysql < /root/master_db.sql   
tonybaloney commented 8 years ago

thats a bug.

tonybaloney commented 8 years ago

fixed.