-
-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fog-core 2.x, fog-json 1.x #433
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -223,16 +223,24 @@ def save | |
end | ||
|
||
def reload | ||
super | ||
@instance_health = nil | ||
@policy_descriptions = nil | ||
self | ||
super | ||
end | ||
|
||
def destroy | ||
requires :id | ||
service.delete_load_balancer(id) | ||
end | ||
|
||
protected | ||
|
||
def all_associations_and_attributes | ||
super.merge( | ||
'ListenerDescriptions' => attributes['ListenerDescriptions'], | ||
'BackendServerDescriptions' => attributes['BackendServerDescriptions'], | ||
) | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you need this? Maybe we need to improve this method on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Attributes are not registered by an This seems like a reasonable workaround using normal OO methodology. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it. I'm not really pointing this as a problem but i'm more interested in knowing the reasons behind it. If it does inflect an in improvement in Are those attributes not being used by the DSL for a particular reason? Is there something i can improve in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They seem to describe related resources but not this resource, which is my they are not included as attributes. If other providers are having this issue, we could introduce a "hidden attribute" (data we want to keep but does not describe the current model). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm. So you mean an BTW, this is not a blocker. I'm just trying to figure out the use case to see if/how we can improve |
||
end | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate on why the new argument is needed? The rest looks good, but I don't think I'm quite groking this. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests asserted this procedure
v = service.volumes.create(device: '/dev/sda1', **)
v.server = service.instances.create(**) # requires :device
In step 1, a device is provided to a volume instance. In step 2, the model calls
Fog.wait_for { ready? }
(implicit reload) and then attaches the server.The issue is between step 1 and 2, there is a property of the local model (
device = '/dev/sda1'
) that does not match the remote model (device = nil
).On
reload
:fog-core 1.x
, thedevice
attribute retained it's value.fog-core 2.x
,device
is set the correct remote value (nil
).IMO a
reload
should put the local model in the same state as the remote model. To enforce that, I've removed the ability forvolume.server = server
to attach volume and instead require callingvolume.attach(server, device)
.