Merge lp:~frankban/juju-quickstart/optional-fields into lp:juju-quickstart

Proposed by Francesco Banconi
Status: Merged
Merged at revision: 129
Proposed branch: lp:~frankban/juju-quickstart/optional-fields
Merge into: lp:juju-quickstart
Diff against target: 293 lines (+73/-35)
4 files modified
quickstart/cli/forms.py (+2/-1)
quickstart/models/envs.py (+56/-19)
quickstart/tests/models/test_envs.py (+11/-11)
tox.ini (+4/-4)
To merge this branch: bzr merge lp:~frankban/juju-quickstart/optional-fields
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+257913@code.launchpad.net

Description of the change

Update provider fields.

Update the list of fields that quickstart
expects for each provider type. Also make
some OpenStack fields optional
(use-floating-ip, tenant-name and region).

Update the links to the provider documentation
(use jujucharms.com).

Update the jujubundlelib dependency to use the
latest one.

Tests: `make check`.

QA:
- check that the environment editing in the
interactive session looks good
(especially the openstack/azure environments
creation).
- use quickstart as usual
(`devenv/bin/juju-quickstart`), to start
(for instance) an ec2 or an azure environment.

https://codereview.appspot.com/234150043/

To post a comment you must log in.
Revision history for this message
Francesco Banconi (frankban) wrote :

Reviewers: mp+257913_code.launchpad.net,

Message:
Please take a look.

Description:
Update provider fields.

Update the list of fields that quickstart
expects for each provider type. Also make
some OpenStack fields optional
(use-floating-ip, tenant-name and region).

Update the links to the provider documentation
(use jujucharms.com).

Update the jujubundlelib dependency to use the
latest one.

Tests: `make check`.

QA:
- check that the environment editing in the
interactive session looks good
(especially the openstack/azure environments
creation).
- use quickstart as usual
(`devenv/bin/juju-quickstart`), to start
(for instance) an ec2 or an azure environment.

https://code.launchpad.net/~frankban/juju-quickstart/optional-fields/+merge/257913

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/234150043/

Affected files (+75, -35 lines):
   A [revision details]
   M quickstart/cli/forms.py
   M quickstart/models/envs.py
   M quickstart/tests/models/test_envs.py
   M tox.ini

Revision history for this message
Brad Crittenden (bac) wrote :

I can no longer login to Reitveld.

Code looks good. QA was fine.

review: Approve (code)
Revision history for this message
Francesco Banconi (frankban) wrote :

*** Submitted:

Update provider fields.

Update the list of fields that quickstart
expects for each provider type. Also make
some OpenStack fields optional
(use-floating-ip, tenant-name and region).

Update the links to the provider documentation
(use jujucharms.com).

Update the jujubundlelib dependency to use the
latest one.

Tests: `make check`.

QA:
- check that the environment editing in the
interactive session looks good
(especially the openstack/azure environments
creation).
- use quickstart as usual
(`devenv/bin/juju-quickstart`), to start
(for instance) an ec2 or an azure environment.

R=
CC=
https://codereview.appspot.com/234150043

https://codereview.appspot.com/234150043/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'quickstart/cli/forms.py'
--- quickstart/cli/forms.py 2014-01-14 15:50:10 +0000
+++ quickstart/cli/forms.py 2015-04-30 15:41:36 +0000
@@ -168,7 +168,8 @@
168 # Unset values are converted to a more convenient value for the168 # Unset values are converted to a more convenient value for the
169 # checkbox (a boolean or a mixed state if allowed by the field).169 # checkbox (a boolean or a mixed state if allowed by the field).
170 value = MIXED if field.allow_mixed else bool(field.default)170 value = MIXED if field.allow_mixed else bool(field.default)
171 label = ('highlight', field.label)171 caption_class = 'highlight' if field.required else 'optional'
172 label = (caption_class, field.label)
172 widget = urwid.CheckBox(label, state=value, has_mixed=field.allow_mixed)173 widget = urwid.CheckBox(label, state=value, has_mixed=field.allow_mixed)
173 widgets = []174 widgets = []
174 if error:175 if error:
175176
=== modified file 'quickstart/models/envs.py'
--- quickstart/models/envs.py 2014-11-13 08:56:19 +0000
+++ quickstart/models/envs.py 2015-04-30 15:41:36 +0000
@@ -407,6 +407,12 @@
407 is_default_field = fields.BoolField(407 is_default_field = fields.BoolField(
408 'is-default', label='default', allow_mixed=False, required=True,408 'is-default', label='default', allow_mixed=False, required=True,
409 help='make this the default environment')409 help='make this the default environment')
410 image_stream_field = fields.SuggestionsStringField(
411 'image-stream', label='image stream', required=False,
412 help='A simplestreams stream to select OS images from. For example '
413 'daily or released images (or any other stream available on '
414 'simplestreams).',
415 suggestions=['released', 'daily'])
410 # Define data structures used as part of the metadata below.416 # Define data structures used as part of the metadata below.
411 ec2_regions = (417 ec2_regions = (
412 'ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2',418 'ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2',
@@ -432,7 +438,7 @@
432 '__fallback__': {438 '__fallback__': {
433 'description': (439 'description': (
434 'This provider type is not supported by quickstart. '440 'This provider type is not supported by quickstart. '
435 'See https://juju.ubuntu.com/docs/getting-started.html for '441 'See https://jujucharms.com/docs/stable/getting-started for '
436 'a description of how to get started with Juju.'442 'a description of how to get started with Juju.'
437 ),443 ),
438 'fields': (444 'fields': (
@@ -451,7 +457,7 @@
451 'This process requires you to have an Amazon Web Services (AWS) '457 'This process requires you to have an Amazon Web Services (AWS) '
452 'account. If you have not signed up for one yet, it can obtained '458 'account. If you have not signed up for one yet, it can obtained '
453 'at http://aws.amazon.com. '459 'at http://aws.amazon.com. '
454 'See https://juju.ubuntu.com/docs/config-aws.html for more '460 'See https://jujucharms.com/docs/stable/config-aws for more '
455 'details on the ec2 provider configuration.'461 'details on the ec2 provider configuration.'
456 ),462 ),
457 'fields': (463 'fields': (
@@ -478,6 +484,7 @@
478 fields.ChoiceField(484 fields.ChoiceField(
479 'region', choices=ec2_regions, default='us-east-1',485 'region', choices=ec2_regions, default='us-east-1',
480 label='region', required=False, help='the ec2 region to use'),486 label='region', required=False, help='the ec2 region to use'),
487 image_stream_field,
481 admin_secret_field,488 admin_secret_field,
482 default_series_field,489 default_series_field,
483 fields.AutoGeneratedStringField(490 fields.AutoGeneratedStringField(
@@ -492,8 +499,8 @@
492 'The openstack provider enables you to run Juju on OpenStack '499 'The openstack provider enables you to run Juju on OpenStack '
493 'private and public clouds. Use this also if you want to '500 'private and public clouds. Use this also if you want to '
494 'set up Juju on HP Public Cloud. See '501 'set up Juju on HP Public Cloud. See '
495 'https://juju.ubuntu.com/docs/config-openstack.html and '502 'https://jujucharms.com/docs/stable/config-openstack and '
496 'https://juju.ubuntu.com/docs/config-hpcloud.html for more '503 'https://jujucharms.com/docs/stable/config-hpcloud for more '
497 'details on the openstack provider configuration.'504 'details on the openstack provider configuration.'
498 ),505 ),
499 'fields': (506 'fields': (
@@ -506,25 +513,31 @@
506 'For HP Public Cloud, use the value suggested below:',513 'For HP Public Cloud, use the value suggested below:',
507 suggestions=['https://region-a.geo-1.identity.hpcloudsvc.com'514 suggestions=['https://region-a.geo-1.identity.hpcloudsvc.com'
508 ':35357/v2.0/']),515 ':35357/v2.0/']),
509 fields.StringField(516 # Optional fields.
510 'tenant-name', label='tenant name', required=True,
511 help='The OpenStack tenant name. For HP Public Cloud, this is '
512 'listed as the project name on the '
513 'https://horizon.hpcloud.com/landing/ page.'),
514 fields.BoolField(517 fields.BoolField(
515 'use-floating-ip', label='use floating IP', allow_mixed=False,518 'use-floating-ip', label='use floating IP', allow_mixed=True,
516 required=True,519 required=False,
517 help='Specifies whether the use of a floating IP address is '520 help='Specifies whether the use of a floating IP address is '
518 'required to give the nodes a public IP address. '521 'required to give the nodes a public IP address. '
519 'Some installations assign public IP addresses by '522 'Some installations assign public IP addresses by '
520 'default without requiring a floating IP address. '523 'default without requiring a floating IP address. '
521 'For HP Public Cloud, floating IP must be activated.'),524 'For HP Public Cloud, floating IP must be activated.'),
525 fields.BoolField(
526 'use-default-secgroup', label='use default security group',
527 allow_mixed=True, required=False,
528 help='Specifies whether new machine instances should have the '
529 '"default" OpenStack security group assigned. It '
530 'defaults to false.'),
531 fields.StringField(
532 'tenant-name', label='tenant name', required=False,
533 help='The OpenStack tenant name. For HP Public Cloud, this is '
534 'listed as the project name on the '
535 'https://horizon.hpcloud.com/landing/ page.'),
522 fields.SuggestionsStringField(536 fields.SuggestionsStringField(
523 'region', label='region', required=True,537 'region', label='region', required=False,
524 help='The OpenStack region to use. '538 help='The OpenStack region to use. '
525 'For HP Public Cloud, use one of the following:',539 'For HP Public Cloud, use one of the following:',
526 suggestions=hp_regions),540 suggestions=hp_regions),
527 # Optional fields.
528 fields.ChoiceField(541 fields.ChoiceField(
529 'auth-mode', label='authentication mode', required=False,542 'auth-mode', label='authentication mode', required=False,
530 default='userpass', choices=('userpass', 'keypair'),543 default='userpass', choices=('userpass', 'keypair'),
@@ -548,6 +561,19 @@
548 fields.PasswordField(561 fields.PasswordField(
549 'secret-key', label='secret key', required=False,562 'secret-key', label='secret key', required=False,
550 help='the secret key to use for the keypair authentication'),563 help='the secret key to use for the keypair authentication'),
564 fields.StringField(
565 'tools-metadata-url', label='tools metadata URL',
566 required=False,
567 help='The location of the Juju tools and metadata. It '
568 'defaults to the global public tools metadata location '
569 'https://streams.canonical.com/tools'),
570 fields.StringField(
571 'image-metadata-url', label='image metadata URL',
572 required=False,
573 help='The location of Ubuntu cloud image metadata. It '
574 'defaults to the global public image metadata location '
575 'https://cloud-images.ubuntu.com/releases'),
576 image_stream_field,
551 fields.AutoGeneratedStringField(577 fields.AutoGeneratedStringField(
552 'control-bucket', label='control bucket', required=False,578 'control-bucket', label='control bucket', required=False,
553 help='the globally unique swift bucket name'),579 help='the globally unique swift bucket name'),
@@ -563,7 +589,7 @@
563 'It requires you to have an Windows Azure account. If you have '589 'It requires you to have an Windows Azure account. If you have '
564 'not signed up for one yet, it can obtained at '590 'not signed up for one yet, it can obtained at '
565 'http://www.windowsazure.com/. See '591 'http://www.windowsazure.com/. See '
566 'https://juju.ubuntu.com/docs/config-azure.html for more '592 'https://jujucharms.com/docs/stable/config-azure for more '
567 'details on the azure provider configuration.'593 'details on the azure provider configuration.'
568 ),594 ),
569 'fields': (595 'fields': (
@@ -594,6 +620,7 @@
594 'location', choices=azure_locations, label='location',620 'location', choices=azure_locations, label='location',
595 required=True, help='the region to use'),621 required=True, help='the region to use'),
596 # Optional fields.622 # Optional fields.
623 image_stream_field,
597 admin_secret_field,624 admin_secret_field,
598 default_series_field,625 default_series_field,
599 is_default_field,626 is_default_field,
@@ -606,8 +633,8 @@
606 'This process requires you to have a Joyent account. If you have '633 'This process requires you to have a Joyent account. If you have '
607 'not signed up for one yet, it can obtained at '634 'not signed up for one yet, it can obtained at '
608 'http://www.joyent.com/. See '635 'http://www.joyent.com/. See '
609 'https://juju.ubuntu.com/docs/config-joyent.html for more details '636 'https://jujucharms.com/docs/stable/config-joyent for more '
610 'on the joyent provider configuration.'637 'details on the joyent provider configuration.'
611 ),638 ),
612 'fields': (639 'fields': (
613 provider_field,640 provider_field,
@@ -666,7 +693,7 @@
666 'turns your bare metal into an elastic cloud-like resource. '693 'turns your bare metal into an elastic cloud-like resource. '
667 'Specifically, MAAS allows for services to be deployed to bare '694 'Specifically, MAAS allows for services to be deployed to bare '
668 'metal via Juju. '695 'metal via Juju. '
669 'See https://juju.ubuntu.com/docs/config-maas.html and '696 'See https://jujucharms.com/docs/stable/config-maas and '
670 'http://maas.ubuntu.com/ for more information about MAAS.'697 'http://maas.ubuntu.com/ for more information about MAAS.'
671 ),698 ),
672 'fields': (699 'fields': (
@@ -685,6 +712,16 @@
685 'drop-down menu that appears when clicking your user '712 'drop-down menu that appears when clicking your user '
686 'name at the top-right of the page.'),713 'name at the top-right of the page.'),
687 # Optional fields.714 # Optional fields.
715 fields.BoolField(
716 'disable-network-management',
717 label='disable Juju network management',
718 allow_mixed=True, required=False,
719 help='Enable this when MAAS is managing the bridge and '
720 'bringing networks up and down. This tells Juju not to '
721 'create a network bridge or to bring eth0 up and down '
722 'during the cloud-init install phase. Juju will not make '
723 'changes to the network configuration when its agents '
724 'start.'),
688 fields.FilePathField(725 fields.FilePathField(
689 'authorized-keys-path', required=False,726 'authorized-keys-path', required=False,
690 label='SSH public key file',727 label='SSH public key file',
@@ -707,7 +744,7 @@
707 'options. Manual provisioning enables you to run Juju on systems '744 'options. Manual provisioning enables you to run Juju on systems '
708 'that have a supported operating system installed. You will need '745 'that have a supported operating system installed. You will need '
709 'to ensure that you have both SSH access and sudo rights. '746 'to ensure that you have both SSH access and sudo rights. '
710 'See https://juju.ubuntu.com/docs/config-manual.html for more '747 'See https://jujucharms.com/docs/stable/config-manual for more '
711 'details on the manual provider configuration, including its '748 'details on the manual provider configuration, including its '
712 'caveats and limitattions.'749 'caveats and limitattions.'
713 ),750 ),
@@ -743,7 +780,7 @@
743 'description': (780 'description': (
744 'The LXC local provider enables you to run Juju on a single '781 'The LXC local provider enables you to run Juju on a single '
745 'system like your local computer or a single server. '782 'system like your local computer or a single server. '
746 'See https://juju.ubuntu.com/docs/config-LXC.html for more '783 'See https://jujucharms.com/docs/stable/config-LXC for more '
747 'details on the local provider configuration.'784 'details on the local provider configuration.'
748 ),785 ),
749 'fields': (786 'fields': (
750787
=== modified file 'quickstart/tests/models/test_envs.py'
--- quickstart/tests/models/test_envs.py 2015-02-09 10:38:25 +0000
+++ quickstart/tests/models/test_envs.py 2015-04-30 15:41:36 +0000
@@ -712,7 +712,8 @@
712 env_metadata = self.env_type_db['ec2']712 env_metadata = self.env_type_db['ec2']
713 expected = [713 expected = [
714 'type', 'name', 'access-key', 'secret-key', 'region',714 'type', 'name', 'access-key', 'secret-key', 'region',
715 'admin-secret', 'default-series', 'control-bucket', 'is-default']715 'image-stream', 'admin-secret', 'default-series', 'control-bucket',
716 'is-default']
716 expected_required = [717 expected_required = [
717 'type', 'name', 'access-key', 'secret-key',718 'type', 'name', 'access-key', 'secret-key',
718 'is-default']719 'is-default']
@@ -724,13 +725,12 @@
724 self.assertIn('openstack', self.env_type_db)725 self.assertIn('openstack', self.env_type_db)
725 env_metadata = self.env_type_db['openstack']726 env_metadata = self.env_type_db['openstack']
726 expected = [727 expected = [
727 'type', 'name', 'auth-url', 'tenant-name', 'use-floating-ip',728 'type', 'name', 'auth-url', 'use-floating-ip',
728 'region', 'auth-mode', 'username', 'password', 'access-key',729 'use-default-secgroup', 'tenant-name', 'region', 'auth-mode',
729 'secret-key', 'control-bucket', 'admin-secret', 'default-series',730 'username', 'password', 'access-key', 'secret-key',
730 'is-default']731 'tools-metadata-url', 'image-metadata-url', 'image-stream',
731 expected_required = [732 'control-bucket', 'admin-secret', 'default-series', 'is-default']
732 'type', 'name', 'auth-url', 'tenant-name', 'use-floating-ip',733 expected_required = ['type', 'name', 'auth-url', 'is-default']
733 'region', 'is-default']
734 self.assert_fields(expected, env_metadata)734 self.assert_fields(expected, env_metadata)
735 self.assert_required_fields(expected_required, env_metadata)735 self.assert_required_fields(expected_required, env_metadata)
736736
@@ -741,7 +741,7 @@
741 expected = [741 expected = [
742 'type', 'name', 'management-subscription-id',742 'type', 'name', 'management-subscription-id',
743 'management-certificate-path', 'storage-account-name', 'location',743 'management-certificate-path', 'storage-account-name', 'location',
744 'admin-secret', 'default-series', 'is-default']744 'image-stream', 'admin-secret', 'default-series', 'is-default']
745 expected_required = [745 expected_required = [
746 'type', 'name', 'management-subscription-id',746 'type', 'name', 'management-subscription-id',
747 'management-certificate-path', 'storage-account-name', 'location',747 'management-certificate-path', 'storage-account-name', 'location',
@@ -769,8 +769,8 @@
769 env_metadata = self.env_type_db['maas']769 env_metadata = self.env_type_db['maas']
770 expected = [770 expected = [
771 'type', 'name', 'maas-server', 'maas-oauth',771 'type', 'name', 'maas-server', 'maas-oauth',
772 'authorized-keys-path', 'admin-secret', 'default-series',772 'disable-network-management', 'authorized-keys-path',
773 'is-default']773 'admin-secret', 'default-series', 'is-default']
774 expected_required = [774 expected_required = [
775 'type', 'name', 'maas-server', 'maas-oauth', 'is-default']775 'type', 'name', 'maas-server', 'maas-oauth', 'is-default']
776 self.assert_fields(expected, env_metadata)776 self.assert_fields(expected, env_metadata)
777777
=== modified file 'tox.ini'
--- tox.ini 2015-04-28 15:25:14 +0000
+++ tox.ini 2015-04-30 15:41:36 +0000
@@ -72,7 +72,7 @@
72 # See https://launchpad.net/~juju/+archive/ubuntu/stable.72 # See https://launchpad.net/~juju/+archive/ubuntu/stable.
73 websocket-client==0.18.073 websocket-client==0.18.0
74 jujuclient==0.50.174 jujuclient==0.50.1
75 jujubundlelib==0.1.575 jujubundlelib==0.1.6
76 urwid==1.2.176 urwid==1.2.1
77 # The distribution PyYAML requirement is used in this case.77 # The distribution PyYAML requirement is used in this case.
7878
@@ -82,7 +82,7 @@
82 # Ubuntu 14.04 (trusty) distro dependencies.82 # Ubuntu 14.04 (trusty) distro dependencies.
83 websocket-client==0.12.083 websocket-client==0.12.0
84 jujuclient==0.17.584 jujuclient==0.17.5
85 jujubundlelib==0.1.585 jujubundlelib==0.1.6
86 PyYAML==3.1086 PyYAML==3.10
87 urwid==1.1.187 urwid==1.1.1
8888
@@ -92,7 +92,7 @@
92 # Ubuntu 14.10 (utopic) distro dependencies.92 # Ubuntu 14.10 (utopic) distro dependencies.
93 websocket-client==0.12.093 websocket-client==0.12.0
94 jujuclient==0.17.594 jujuclient==0.17.5
95 jujubundlelib==0.1.595 jujubundlelib==0.1.6
96 PyYAML==3.1196 PyYAML==3.11
97 urwid==1.2.197 urwid==1.2.1
9898
@@ -102,7 +102,7 @@
102 # Ubuntu 15.04 (vivid) distro dependencies.102 # Ubuntu 15.04 (vivid) distro dependencies.
103 websocket-client==0.18.0103 websocket-client==0.18.0
104 jujuclient==0.18.5104 jujuclient==0.18.5
105 jujubundlelib==0.1.5105 jujubundlelib==0.1.6
106 PyYAML==3.11106 PyYAML==3.11
107 urwid==1.2.1107 urwid==1.2.1
108108

Subscribers

People subscribed via source and target branches