Skip to content

Commit 4aff7b4

Browse files
committed
Merge pull request #20 from AsrOneSdk/neha-dev
Fixing create protection profile name input logic
2 parents 277c794 + 3875c7c commit 4aff7b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Service/StartAzureSiteRecoveryProtectionProfileAssociationJob.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ HyperVReplicaAzureProtectionProfileInput hyperVReplicaAzureProtectionProfileInpu
114114

115115
CreateProtectionProfileInput createProtectionProfileInput =
116116
new CreateProtectionProfileInput(
117-
this.ProtectionProfile.Name,
117+
string.IsNullOrEmpty(this.ProtectionProfile.Name) ? this.PrimaryProtectionContainer.Name : this.ProtectionProfile.Name,
118118
this.ProtectionProfile.ReplicationProvider,
119119
DataContractUtils<HyperVReplicaAzureProtectionProfileInput>.Serialize(hyperVReplicaAzureProtectionProfileInput));
120120

@@ -154,8 +154,8 @@ HyperVReplicaProtectionProfileInput hyperVReplicaProtectionProfileInput
154154
};
155155

156156
CreateProtectionProfileInput createProtectionProfileInput =
157-
new CreateProtectionProfileInput(
158-
this.ProtectionProfile.Name,
157+
new CreateProtectionProfileInput( // Name of the protection profile as the name of the protection container if not given
158+
string.IsNullOrEmpty(this.ProtectionProfile.Name) ? this.PrimaryProtectionContainer.Name : this.ProtectionProfile.Name,
159159
this.ProtectionProfile.ReplicationProvider,
160160
DataContractUtils<HyperVReplicaProtectionProfileInput>.Serialize(hyperVReplicaProtectionProfileInput));
161161

0 commit comments

Comments
 (0)