Skip to content

Commit

Permalink
Merge pull request #180 from clarkperkins/feature/rename-providers
Browse files Browse the repository at this point in the history
Feature/rename providers
  • Loading branch information
clarkperkins committed Jul 16, 2015
2 parents 136c235 + fd1b120 commit 1e505b1
Show file tree
Hide file tree
Showing 26 changed files with 691 additions and 636 deletions.
11 changes: 4 additions & 7 deletions stackdio/api_v1/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ def get(self, request, format=None):
format=format)),

('cloud', OrderedDict((
('provider_types', reverse('cloudprovidertype-list',
request=request,
format=format)),
('providers', reverse('cloudprovider-list',
request=request,
format=format)),
('accounts', reverse('cloudaccount-list',
request=request,
format=format)),
('profiles', reverse('cloudprofile-list',
request=request,
format=format)),
Expand All @@ -76,9 +76,6 @@ def get(self, request, format=None):
('stacks', reverse('stack-list',
request=request,
format=format)),
('snapshots', reverse('snapshot-list',
request=request,
format=format)),
('volumes', reverse('volume-list',
request=request,
format=format)),
Expand All @@ -100,7 +97,7 @@ def get(self, request, format=None):
##
url(r'^', include('users.urls')),
url(r'^', include('core.urls')),
url(r'^', include('cloud.urls')),
url(r'^cloud/', include('cloud.urls')),
url(r'^', include('stacks.urls')),
url(r'^', include('volumes.urls')),
url(r'^', include('blueprints.urls')),
Expand Down
4 changes: 2 additions & 2 deletions stackdio/blueprints/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def create(self, data, **kwargs):
spot_price=spot_price,
)

if profile_obj.cloud_provider.vpc_enabled:
if profile_obj.cloud_account.vpc_enabled:
kwargs['subnet_id'] = host.get('subnet_id')
else:
zone_obj = CloudZone.objects.get(pk=host['zone'])
Expand Down Expand Up @@ -258,7 +258,7 @@ class Meta:
# Only for EC2 classic
zone = models.ForeignKey('cloud.CloudZone', null=True, blank=True)

# The subnet id for VPC enabled providers
# The subnet id for VPC enabled accounts
# Only for EC2 VPC
subnet_id = models.CharField('Subnet ID', max_length=32, blank=True, default='')

Expand Down
4 changes: 2 additions & 2 deletions stackdio/blueprints/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def _validate_hosts(self):
cloud_profile = models.CloudProfile.objects.get(
pk=host['cloud_profile']
)
if not cloud_profile.cloud_provider.vpc_enabled:
if not cloud_profile.cloud_account.vpc_enabled:
host_errors.update(self._validate_host_zone(host))
else:
host_errors.update(self._validate_host_subnet(host))
Expand Down Expand Up @@ -231,7 +231,7 @@ def _validate_host_zone(self, host):

def _validate_host_subnet(self, host):
e = {}
# Subnets are for hosts being launched into a provider that's using
# Subnets are for hosts being launched into an account that's using
# VPC
if 'subnet_id' not in host:
e['subnet_id'] = ValidationErrors.REQUIRED_FIELD
Expand Down
22 changes: 11 additions & 11 deletions stackdio/cloud/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
from . import models


class CloudProviderTypeAdmin(GuardedModelAdmin):
class CloudProviderAdmin(GuardedModelAdmin):
list_display = [
'type_name',
'name',
]


admin.site.register(models.CloudProviderType, CloudProviderTypeAdmin)
admin.site.register(models.CloudProvider, CloudProviderAdmin)


class CloudProviderAdmin(GuardedModelAdmin):
class CloudAccountAdmin(GuardedModelAdmin):
list_display = [
'title',
'slug',
Expand All @@ -40,15 +40,15 @@ class CloudProviderAdmin(GuardedModelAdmin):
]


admin.site.register(models.CloudProvider, CloudProviderAdmin)
admin.site.register(models.CloudAccount, CloudAccountAdmin)


class CloudInstanceSizeAdmin(GuardedModelAdmin):
list_display = [
'title',
'slug',
'description',
'provider_type',
'provider',
'instance_id',
]

Expand All @@ -59,7 +59,7 @@ class CloudInstanceSizeAdmin(GuardedModelAdmin):
class GlobalOrchestrationFormulaComponentAdmin(GuardedModelAdmin):
list_display = [
'component',
'provider',
'account',
'order',
]

Expand All @@ -71,7 +71,7 @@ class GlobalOrchestrationFormulaComponentAdmin(GuardedModelAdmin):
class CloudProfileAdmin(GuardedModelAdmin):
list_display = [
'title',
'cloud_provider',
'account',
'image_id',
'default_instance_size',
'ssh_user',
Expand All @@ -85,7 +85,7 @@ class SnapshotAdmin(GuardedModelAdmin):
list_display = [
'title',
'slug',
'cloud_provider',
'account',
'snapshot_id',
'size_in_gb',
'filesystem_type',
Expand All @@ -100,7 +100,7 @@ class CloudRegionAdmin(GuardedModelAdmin):
'title',
'slug',
'description',
'provider_type',
'provider',
]


Expand All @@ -123,7 +123,7 @@ class SecurityGroupAdmin(GuardedModelAdmin):
list_display = [
'name',
'group_id',
'cloud_provider',
'account',
'is_default',
]

Expand Down

0 comments on commit 1e505b1

Please sign in to comment.